I have a date in string, provide by webservices:
2013-05-13T10:06:34.023-03:00
How to parse this to Java Date?
SimpleDateFormat with yyyy-MM-dd HH:mm
doesn't work...
I need only date and time (not -3:00).
Thanks, Mateus
I have a date in string, provide by webservices:
2013-05-13T10:06:34.023-03:00
How to parse this to Java Date?
SimpleDateFormat with yyyy-MM-dd HH:mm
doesn't work...
I need only date and time (not -3:00).
Thanks, Mateus
yyyy-MM-dd HH:mm
does not work because it does not match your example.
What about "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
?
I took this pattern from JavaDoc of SimpleDateFormat
: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
You need to use:
yyyy-MM-dd'T'HH:mm:ss.SSSZ
as per the JavaDoc for SimpleDateFormat
.
I would also suggest you do need the -3:00
- this is the timezone the time applies to and says the time is UTC -3 hours.