File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Need your help in DATE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Need your help in DATE" Watch "Need your help in DATE" New topic

Need your help in DATE

Deepa Balasubramanayam
Ranch Hand

Joined: Mar 29, 2001
Posts: 39
I have a doubt in date. I am passing date values in mm/dd/yy format and storing it in the database(MSAccess). But when i am displaying it in the screen i want it like this Apr 24, 2001. Can you tell me how can i do this.
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Deepa,
Look at java.text.SimpleDateFormat!
Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat( "MMM dd, yyyy" );
System.out.println( sdf.format( d ) );
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Try this :

Look up java.text.SimpleDateFormat in the APIs if you want more information and options on formatting dates.


Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: Need your help in DATE
It's not a secret anymore!