0

I have the string Thu Nov 12 00:00:00 GMT 2015 which is EEE MMM dd HH:mm:ss ZZZ yyyy.

I want to convert this string into a string with the format of dd/MM/yyyy, or in this case 12/11/2015.

Dan
  • 7,286
  • 6
  • 49
  • 114

1 Answers1

2
SimpleDateFormat sFrom = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZ yyyy");
SimpleDateFormat sTo = new SimpleDateFormat("dd/MM/yyyy");
String result = sTo.format(sFrom.parse("Thu Nov 12 00:00:00 GMT 2015"));
Divers
  • 9,531
  • 7
  • 45
  • 88