hi i am using Joda time to convert my string dates to DateTime objects.
I currently have the following string:
2014-02-16T00:17:20.000Z
how do i convert this to a DateTime object?
I have tried:
DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ssZZZ");
DateTime dt = formatter.parseDateTime("2014-02-16T00:17:20.000Z");
But i am getting the following error:
java.lang.IllegalArgumentException: Invalid format: "2014-02-16T00:17:20.000Z" is malformed at ".000Z"
Any help is greatly appreciated
For future visitors, simpler solution:
String date = "2014-02-16T00:17:20.000Z";
DateTime dateTime = new DateTime(date);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With