-1

I have date and time this format

$date:2013-02-19T11:20:16.393Z

and I can convert normal format for example:

19.02.2013 11:20:16 
Ares
  • 31
  • 1
  • 2
  • 8

1 Answers1

3
$date:2013-02-19T11:20:16.393Z

So your actual format is ISO 8601 For your goal you need to use some DateFormatter with proper pattern and work is done.

At first you need to rewrite your date into pattern so

19.02.2013 11:20:16 is equal to dd.MM.yyyy HH:mm:ss

So now you need to use formatter for example SimpleDateFormatter that perform converting.

Pseudocode:

String source = "2013-02-19T11:20:16.393Z";
SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
Date formatted = null;
formatted = formatter.parse(source);
String formattedString = formatted.toString();
Simon Dorociak
  • 33,374
  • 10
  • 68
  • 106