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 3a46e6e commit 4e52a6dCopy full SHA for 4e52a6d
1 file changed
lib/source/pl/lib/std/time.cpp
@@ -67,7 +67,13 @@ namespace pl::lib::libstd::time {
67
auto time = time_t(params[0].toUnsigned());
68
69
try {
70
+#ifdef _MSC_VER
71
+ std::tm localTimeStruct;
72
+ localtime_s(&localTimeStruct, &time);
73
+ auto localTime = &localTimeStruct;
74
+#else
75
auto localTime = std::localtime(&time);
76
+#endif // _MSC_VER
77
if (localTime == nullptr) return u128(0);
78
79
return { packTMValue(*localTime, runtime) };
0 commit comments