DateTime dt = new LocalDateTime(timestamp.getTime()).toDateTime(DateTimeZone.UTC);
LocalDateTime dt = new LocalDateTime(t.getTime());
Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).
It worked using LocalDateTime but why DateTime is behaving like this? Is there any solution for it?
Joda DateTime treats any time in millis like "millis since 1970y in current time zone". So, when you create DateTime instance, it is created with current time zone.
Please check the edit, I have mentioned the output there