I have problems with formatting server time. Server is on central time I guess. I need to format following string 2016-08-22T10:29:22
in default zone (Central European Summer Time = GMT+2). I tried with Joda-Time
library, I need to get 12:29:22, but I only managed to get same date with +02:00 the end, with code like this:
DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss");
DateTime dateTime = formatter.withZone(DateTimeZone.getDefault()).parseDateTime(time);
Output of this code is: 2016-08-22T10:29:22.000+02:00
, when I try to dateTime.getHourOfDay();
- I getting 10 again.
Where am I going wrong?