Skip to content

[C++][Gandiva] Use timegm in date_time_test utilities to avoid DST-dependent behavior #49952

Description

@Reranko05

Describe the enhancement requested

Description

As discussed in PR #49887, the Gandiva datetime test utilities currently use mktime(), which interprets tm values as local time and may behave differently across platforms and DST boundaries.

The existing Epoch() helper also contains a workaround for mktime() behavior on Windows/MSVC.

A cleaner approach is to use timegm() (and _mkgmtime() on Windows) so the test utilities consistently interpret timestamps as UTC.

This follow-up issue proposes:

  • replacing mktime() with timegm() in date_time_test.cc
  • adding a small Windows compatibility mapping for _mkgmtime
  • removing the existing DST/localtime workaround logic in Epoch()

This should make the datetime tests more deterministic and avoid environment-dependent DST behavior.

Follow-up from PR #49887 and issue #41605.

Component(s)

C++

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions