-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
filterx: Fix strptime to remove unwanted gmtoff in datetime conversion
The strptime function relies on the wallclocktime_strptime utility to parse time, leveraging its extensive heuristics. Additionally, we use the wallclocktime to unixtime conversion from the wallclocktime module, as the internal time representation in filterx datetime is unixtime. However, this conversion introduces an unintended side effect: the GMT offset (gmtoff) value is retained even after converting to UTC. This results in a double application of the time offset when the unixtime handler functions process the timestamp later. To address this issue, the simplest solution was to manually reset the GMT offset (gmtoff) to zero after the conversion. This approach is questionable, as it discards timezone information at the moment of creating the datetime object in certain cases. A potential improvement could involve creating a custom wallclocktime-to-unixtime converter to avoid such side effects.
- Loading branch information
Showing
3 changed files
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters