arrow
arrow copied to clipboard
[C++][Gandiva] Use timegm in date_time_test utilities to avoid DST-dependent behavior
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()withtimegm()indate_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++
Issue resolved by pull request 49953 https://github.com/apache/arrow/pull/49953