I tried this with Jodatime DateTime
,
DateTime dateTime = DateTime .parse("1-JAN-1900", DateTimeFormat.forPattern("dd-MMM-yyyy")) .plusSeconds(2075866000); String dateTimeStr = DateTimeFormat.forPattern( "yyyy/MM/dd HH:mm:ss").print(dateTime); System.out.println(dateTimeStr);
I also tried using Jodatime MutableDateTime
MutableDateTime dateTime = MutableDateTime .parse("1-JAN-1900", DateTimeFormat.forPattern("dd-MMM-yyyy")); dateTime.add(DurationFieldType.seconds(), 2075866000); String dateTimeStr = DateTimeFormat.forPattern( "yyyy/MM/dd HH:mm:ss").print(dateTime.toDateTime()); System.out.println(dateTimeStr);
Both give me the same result, 1965/10/13 06:09:54
.
I expect 1965/10/13 05:26:40
, instead. I get this using the Oracle query below
select to_date('1900-JAN-1') + 2075866000/86400 from dual
And after the conflict between Joda and Oracle, I tried Wolframalpha , which also gives me the same result as Oracle.
Can someone please explain why this difference?
source share