aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/utils/calendar.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/utils/calendar.cpp b/src/lib/utils/calendar.cpp
index 4f6c835d1..ddd424e0e 100644
--- a/src/lib/utils/calendar.cpp
+++ b/src/lib/utils/calendar.cpp
@@ -121,10 +121,11 @@ std::chrono::system_clock::time_point calendar_point::to_std_timepoint() const
// 32 bit time_t ends at January 19, 2038
// https://msdn.microsoft.com/en-us/library/2093ets1.aspx
- // For consistency reasons, throw after 2037 as long as
- // no other implementation is available.
- if (year > 2037)
+ // Throw after 2037 if 32 bit time_t is used
+ if (year > 2037 && sizeof(std::time_t) == 4)
+ {
throw Invalid_Argument("calendar_point::to_std_timepoint() does not support years after 2037.");
+ }
// std::tm: struct without any timezone information
std::tm tm;