The final goal is to convert a timestamp passed down from the server to local time.
Here's what I get:
2018-04-05T16:14:19.130Z
However, my local time is 11:14 AM CST
. Here's what I've tried:
final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
final LocalTime localTime = formatter.parseLocalTime(text);
Timber.i(localTime.toString()); // output: 16:14:19.070
Output is: 16:14:19.070
. Does anybody know how to use it? I expected to receive something like 11:14 AM
.
Also, I've tried using this:
final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
final DateTime time = formatter.parseDateTime(text);
Timber.i(time.toString()); // output: 2018-04-05T16:14:19.490-05:00
Looks like it's a 5-hour difference there? Does anybody know how I can use this to convert to local time?