This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes Behaviour of parse() method in SimpleDateFormat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Behaviour of parse() method in SimpleDateFormat" Watch "Behaviour of parse() method in SimpleDateFormat" New topic
Author

Behaviour of parse() method in SimpleDateFormat

Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Hi All,

I am trying to use SimpleDateFormat to format the date, as in the following code.




The output I get is : 14-Jan-2003. The month is displayed as "Jan" invariably for all the dates.

Any clue, why such a thing is happening, or should parse() method be used more appropriately?

Thanks a lot for your help.

Cheers,
Ram
[ July 27, 2005: Message edited by: Ramaswamy Srinivasan ]
Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657

Lowercase 'm' is for minutes...

Change this...
...to this...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Behaviour of parse() method in SimpleDateFormat
 
Similar Threads
Using Deprecated API in Code
convert a string to java.sql.Date object
string to date parsing ....
dates and JDBC
string to timestamp