aspose 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to get date format in number?
 
Similar Threads
unable to retrieve timestamp in my servlet
Date comparision in SQL from timestamp
How do i format a string to date
unable to retrieve timestamp in my servlet
convert date format