We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5583fbb commit c9707efCopy full SHA for c9707ef
Release/src/utilities/asyncrt_utils.cpp
@@ -649,6 +649,10 @@ utility::string_t datetime::to_string(date_format format) const
649
const int64_t input = static_cast<int64_t>(m_interval / _secondTicks); // convert to seconds
650
const int frac_sec = static_cast<int>(m_interval % _secondTicks);
651
const time_t time = static_cast<time_t>(input - ntToUnixOffsetSeconds);
652
+ if (static_cast<uint64_t>(time) > 253370764800ull) {
653
+ throw std::out_of_range("The requested year exceeds the year 9999.");
654
+ }
655
+
656
struct tm t;
657
#ifdef _MSC_VER
658
if (gmtime_s(&t, &time) != 0)
0 commit comments