This is the date coming from db 2015-06-0403:34:38
I have parsed it like this
DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm:ss");
DateTime dateTime = formatter.withOffsetParsed().parseDateTime("2015-06-0403:34:38");
result : 2015-06-04T03:34:38.000+05:00
Now I want this date to add the GMT automatically with +5 in this case
so the date would be 2015-06-04 08:34:38
I have tried to add the timezone like this
java.util.Calendar now = java.util.Calendar.getInstance();
java.util.TimeZone timeZone = now.getTimeZone();
DateTimeZone dtZone = DateTimeZone.forID(timeZone.getID());
DateTime dateTimez = dateTime.toDateTime(dtZone);
result : 2015-06-04T03:34:38.000+05:00 (which is wrong)
I am using JodaTime
.