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 c52b1a7 commit cc6ad67Copy full SHA for cc6ad67
include/cppcore/Common/DateTime.h
@@ -45,8 +45,11 @@ struct DateTime {
45
DateTime() {
46
time_t timestamp = ::time(nullptr);
47
tm dt{};
48
- dt = *::localtime(×tamp);
49
- year = dt.tm_year + 1900;
+#if defined(_WIN32)
+ ::localtime_s(&dt, ×tamp);
50
++#else
51
+ ::localtime_r(×tamp, &dt);
52
++#endif year = dt.tm_year + 1900;
53
month = dt.tm_mon;
54
day = dt.tm_mday;
55
hour = dt.tm_hour;
0 commit comments