Skip to content

Fix DST handling in ORM model date/datetime conversion#2536

Merged
an-tao merged 1 commit into
drogonframework:masterfrom
Geaboi:bugfix/2534-dst-mktime-in-model-template
Jun 29, 2026
Merged

Fix DST handling in ORM model date/datetime conversion#2536
an-tao merged 1 commit into
drogonframework:masterfrom
Geaboi:bugfix/2534-dst-mktime-in-model-template

Conversation

@Geaboi

@Geaboi Geaboi commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #2534

After memset, tm_isdst is 0, which tells mktime DST is not active.
This causes datetime values during DST periods to be converted with the
wrong UTC offset (off by one hour).

Setting tm_isdst = -1 lets the system determine DST from the local timezone rules, matching the fix already applied in trantor (Date.cc:44).

@an-tao an-tao merged commit 85edc33 into drogonframework:master Jun 29, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Same issue than trantor::Date https://github.com/an-tao/trantor/pull/140

2 participants