aspose file tools*
The moose likes Java in General and the fly likes Help for using Java Time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Help for using Java Time" Watch "Help for using Java Time" New topic
Author

Help for using Java Time

Paul li
Greenhorn

Joined: Aug 08, 2008
Posts: 2


The output is as the following:
Thu May 22 00:09:44 EDT 2008
2008-09-22 00:09:44 -0400

The format is correctly changed, but the time is wrong.

Please help...

Thanks,
Paul
[ August 08, 2008: Message edited by: Paul li ]
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 685
the time is wrong.

What is the correct value?
Looks like the month is wrong. May is the 5th month.

You need to read the doc for the formatting letter usage. m vs M
[ August 09, 2008: Message edited by: Norm Radder ]
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3949
    
  17

Originally posted by Paul li:


The output is as the following:
Thu May 22 00:09:44 EDT 2008
2008-09-22 00:09:44 -0400

The format is correctly changed, but the time is wrong.
[ August 08, 2008: Message edited by: Paul li ]


It looks like the time is right, but the date is wrong. The pattern should be "yyyy-MM-dd HH:mm:ss Z". Capital M for Month, small m for minutes.


Steve
Paul li
Greenhorn

Joined: Aug 08, 2008
Posts: 2
Norm, Steve,

Big help! Thanks a lot!

Paul
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help for using Java Time
 
Similar Threads
Parsing date..?
how to convert date to a string
date format conversion to MM/dd/yyyy hh:mm a
How to fetch Date Field from excel sheet in Java
Timezone offset to Timezone ID conversion