Skip to content

OaIdl.DATE(Date javaDate) sets wrong date in some cases #1460

@eranl

Description

@eranl
  1. Version of JNA and related jars: 5.12.1

  2. Version and vendor of the java virtual machine:
    IMPLEMENTOR="Oracle Corporation"
    JAVA_VERSION="17.0.1"

  3. Operating system: Windows 7

  4. System architecture (CPU type, bitness of the JVM): x86_64

  5. 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.

  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions