I want to use org.joda.time.DateTime. It need the following params:
DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, DateTimeZone zone)
Now the problem is, that I need the DateTimeZone, but I only know the offset compared to UTC, but how can I build this DateTime without knowing the exact name? All I have is a long value (e.g. 50400000) with offset in millis. The other values like year, hour, seconds etc are given.
Does anyone have some ideas?
If you know the offset, you can use DateTimeZone.forOffsetMillis
to create a fixed-offset time zone.
That won't necessarily be the real time zone, but the offset alone isn't enough information to tell you the real time zone.
See more on this question at Stackoverflow