• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Change format of date String-string

 
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
 
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
 
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.
 
Have you no shame? Have you no decency? Have you no tiny ad?
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!