This week's book giveaway is in the Agile forum.
We're giving away four copies of The Software Craftsman and have Sandro Mancuso on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Displaying Date in Format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Displaying Date in Format "mm/dd/yyyy"" Watch "Displaying Date in Format "mm/dd/yyyy"" New topic
Author

Displaying Date in Format "mm/dd/yyyy"

payal Jain
Ranch Hand

Joined: Dec 20, 2007
Posts: 50
Hi,
I get a date object as 2008-09-26 and need to be formatted in mm/dd/yyyy format.
i tried with simple date format
which gives mee result as 00/26/2008
can any one tell me why this is happening??
my code is:
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14667
    
  25

You should use MM for months - mm is for minutes.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
 
subject: Displaying Date in Format "mm/dd/yyyy"