wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes How to print  default date in required format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to print  default date in required format" Watch "How to print  default date in required format" New topic
Author

How to print default date in required format

Priya Sri
Ranch Hand

Joined: Mar 30, 2004
Posts: 84
Hi friends,

I was not able to print date in required format....

Iam getting current date using

Date mydate=new Date();

By printing mydate , it is showing date in long format....
How should i get my date in simple format like "29/10/2004"

I tried using SimpleDateFormat and DateFormat.. But I was not able to get it...

Thanx in advance..
bye
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


But I was not able to get it...

Well, SimpleDateFormat is the simple way of doing this. What went wrong?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Fisher Daniel
Ranch Hand

Joined: Sep 14, 2001
Posts: 582
Hi,
I usually using DateFormatUtils from org.apache.commons.lang.time to convert date into a specific format.



Hope this help...
Correct me if I am wrong
daniel
Sunil Manheri
Ranch Hand

Joined: Jul 07, 2004
Posts: 32


TechMindViews - Technical Notes
Priya Sri
Ranch Hand

Joined: Mar 30, 2004
Posts: 84
Thank u...

I got it...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to print default date in required format