• Post Reply Bookmark Topic Watch Topic
  • New Topic

Convert date format (Sat Jan 03 00:00:00 EST 2004 to 03-JAN-06)  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

quick question: I jave an object type Date. when I output to a csv file I see the date as: Sat Jan 03 00:00:00 EST 2004, I would like to have it in a simple format: 03-Jan-04

I played with SimpleDateFormat but I didnt get any result.

can anyone assist?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will depend on the Locale. You can try with the US one.
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!