File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes How to get date format in number? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to get date format in number?" Watch "How to get date format in number?" New topic
Author

How to get date format in number?

Sham Jowsaki
Ranch Hand

Joined: May 22, 2001
Posts: 146
Hi all,
How to get the following date() format
2002-12-31T12:00:00
Thanks
Jowsaki
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
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.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Richard Jensen
Ranch Hand

Joined: May 14, 2003
Posts: 67
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 ]

Richard
N 37 33 W 122 18
Sham Jowsaki
Ranch Hand

Joined: May 22, 2001
Posts: 146
Thanks Carl n Richard..
Working your stuffs SimpleDateFormat.
Thanks
Jowsaki
 
 
subject: How to get date format in number?
 
Similar Threads
convert date format
unable to retrieve timestamp in my servlet
unable to retrieve timestamp in my servlet
How do i format a string to date
Date comparision in SQL from timestamp