Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed failing of lysp_check_date when using DST configurations with savingtimes >=24h #2310

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tree_schema_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ lysp_check_date(struct lysp_ctx *ctx, const char *date, size_t date_len, const c
}
memcpy(&tm_, &tm, sizeof tm);

/* DST may move the hour back resulting in a different day */
tm_.tm_hour = 1;
/* Disabling DST: Set tm_isdst to -1 so that mktime() won't adjust for daylight saving time. */
tm_.tm_isdst = -1;

mktime(&tm_); /* mktime modifies tm_ if it refers invalid date */
if (tm.tm_mday != tm_.tm_mday) { /* e.g 2018-02-29 -> 2018-03-01 */
Expand Down
Loading