• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to format datetime?  RSS feed

 
Siegfried Heintze
Ranch Hand
Posts: 417
  • 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
Sheriff
Posts: 16007
87
Android IntelliJ IDE Java Scala Spring
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!