File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to format datetime?

 
Siegfried Heintze
Ranch Hand
Posts: 403
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm doing following presently when fetching date from JDBC:


Please tell me there is a better way! How can I format my date with a single formatter?
Thanks,
Siegfried
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can just use SimpleDateFormat. Why do you think you need separate formatters for the date and time parts?

See the API documentation of java.text.SimpleDateFormat for info on the format specification string.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic