-3

Has java any function where I have a String with a date in this form : ddMMyy or dd.MM.yy
and I want to convert it in another format like: dd:MM:yy

InfernoVol
  • 113
  • 1
  • 3
  • 9

1 Answers1

1

I would suggest using two SimpleDateFormat objects for this.

Date date = new SimpleDateFormat("ddMMyy").parse( dateString);
String result = new SimpleDateFormat("dd:MM:yy").format( date );

For the format, see the documentation: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

Florian Schaetz
  • 10,454
  • 5
  • 32
  • 58