-
Notifications
You must be signed in to change notification settings - Fork 1.7k
OaIdl.DATE(Date javaDate) sets wrong date in some cases #1460
Description
-
Version of JNA and related jars: 5.12.1
-
Version and vendor of the java virtual machine:
IMPLEMENTOR="Oracle Corporation"
JAVA_VERSION="17.0.1" -
Operating system: Windows 7
-
System architecture (CPU type, bitness of the JVM): x86_64
-
Complete description of the problem:
When com.sun.jna.platform.win32.OaIdl.DATE(Date javaDate) is called with a javaDate whose time part converted to local time is between midnight and 1am, while DST (60-minute offset) is on, the date portion of the resulting DATE object is of the previous day, while the time portion is correct, which means that the DATE object is 24 hours behind. -
Steps to reproduce:
Simple test: with DST on, instantiate one OaIdl.DATE(Date javaDate) with a javaDate having the time 12:30am local time and another with 1:30am local time, with the same date, and you'll see that the resulting DATEs have different integralParts.