• Post Reply Bookmark Topic Watch Topic
  • New Topic

Change format of date String-string  RSS feed

 
Nicola Ace
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello i have to change the format of a String that contains a date.
Example.

Mine string contains: Thu May 14 09:48:39 CEST 2009
I would like to have a string formatted like : 14/05/2009

The conversione is not string-date or vice versa, i need it to be String-string

Hope someone can help me
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need it to be from String to String without a Date? Because Date and DateFormatter where made for this.

// Edit: Small mistake
 
Christian Dillinger
Ranch Hand
Posts: 200
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parse it via DateFormat to a Date (df1.parse()), format it with another DateFormat (df2.format()) to string.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!