Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get date format in number?

 
Sham Jowsaki
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
How to get the following date() format
2002-12-31T12:00:00
Thanks
Jowsaki
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using SimpleDateFormat something like:

Note, text you want in the string not to be used as a pattern (Such as the T or if you wanted the word Time) needs to be in single quotes.
 
Richard Jensen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SimpleDateFormat (1.3)
"yyyy-MM-dd'T'hh:mm:ss"
[ August 11, 2003: Message edited by: Richard Jensen ]
[ August 11, 2003: Message edited by: Richard Jensen ]
 
Sham Jowsaki
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Carl n Richard..
Working your stuffs SimpleDateFormat.
Thanks
Jowsaki
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic