jQuery in Action, 2nd edition*
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 Android Security Essentials Live Lessons this week in the Android 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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to print default date in required format
 
Similar Threads
error in formatting miliseconds for date objects
DateFormat
Passing sysdate as parameter to Oracle procedure
integer number too large:
Date Format in JAVA