From 1a70f8c8a8893fd06fdedb9d1b9e73d6c114bf99 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 26 Mar 2026 21:58:44 -0400 Subject: [PATCH] Prevent overflow when using 32 bit minutes * Fixes #908 --- include/date/date.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/date/date.h b/include/date/date.h index 29cecdc..6e6bdd0 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -8047,7 +8047,7 @@ from_stream(std::basic_istream& is, const CharT* fmt, { if (offset_local != std::chrono::minutes::min()) { - tp = round_i(sys_days(fds.ymd) - offset_local + fds.tod.to_duration()); + tp = round_i(sys_days(fds.ymd) + fds.tod.to_duration() - offset_local); if (offset != nullptr) *offset = offset_local; }