I am trying to create a date with absolute field values through JODA DateTime, for example (an example is given in the era for simpler examples):
new DateTime(1970, 1, 1, 1, 0, 0, 0, DateTimeZone.forId("GMT+0").toDate()
The JODA DateTime object correctly displays the hour as 1AM, if I check it, all absolute values are accurate and correct (1 hour, 3600 seconds, 3600000 milliseconds from an era, etc.), but as soon as toDate () and java.util.Date kicks in it becomes 2AM because it adds the DST of the current time of my system, although I explicitly created a DateTime object with an offset of GMT + 0.
How can I ignore the DST offset and just say Java to create me java.util.Date with the absolute values I want? Unfortunately, I am dealing with legacy code and I am stuck with using java.util.Date, so everything has switched to Joda, this is not an option in the short term.
Thank.
source
share