SAP / SapMachine

An OpenJDK release maintained and supported by SAP
https://sapmachine.io
GNU General Public License v2.0
510 stars 94 forks source link

Return date/time not consistent since sapmachine-11.0.17 onward #1409

Open catinthesky opened 1 year ago

catinthesky commented 1 year ago

We observed that when with below code:

Calendar calendar = Calendar.getInstance();
// set date to 1st Jan 1900
calendar.set(1900, 0, 1);
//SMALL_DATE = new Date(DateUtils.startOfTheDay(calendar.getTime()).getTime());
SMALL_DATE = new Date(startOfTheDay(calendar.getTime()).getTime());
 ((Date) SMALL_DATE.clone()).getTime())

((Date) SMALL_DATE.clone()).getTime()) this will return different value since sapmachine-11.0.17 compared with sapmachine-11.0.16, if the VM timezone set to be like: "Time zone: Europe/Amsterdam (CEST, +0200)"

MBaesken commented 1 year ago

There might be some related changes in tzdata2022b . Please see http://mm.icann.org/pipermail/tz-announce/2022-August/000071.html ; this would correspond to 11.0.17 and mentions changes to previous timestamps.

Regarding your snippet not sure where startOfTheDay would come from.