Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to print default date in required format

 
Priya Sri
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

But I was not able to get it...

Well, SimpleDateFormat is the simple way of doing this. What went wrong?
 
Fisher Daniel
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Priya Sri
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u...

I got it...
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic