mirror of
https://github.com/sam-astro/Z-Sharp.git
synced 2025-12-11 16:22:12 +00:00
Update builtin.h
This commit is contained in:
parent
dc580c2257
commit
b25fee150a
@ -198,9 +198,17 @@ int LogCriticalError(const string& errorText)
|
|||||||
time_t timer = time(0);
|
time_t timer = time(0);
|
||||||
|
|
||||||
tm bt{};
|
tm bt{};
|
||||||
#if defined(__unix__)
|
#if UNIX
|
||||||
//localtime_r(&timer, &bt);
|
time_t currentTime;
|
||||||
#elif defined(_MSC_VER)
|
struct tm* localTime;
|
||||||
|
|
||||||
|
time(¤tTime); // Get the current time
|
||||||
|
localTime = localtime(¤tTime); // Convert the current time to the local time
|
||||||
|
|
||||||
|
Hour = localTime->tm_hour;
|
||||||
|
Min = localTime->tm_min;
|
||||||
|
Sec = localTime->tm_sec;
|
||||||
|
#elif WINDOWS
|
||||||
localtime_s(&bt, &timer);
|
localtime_s(&bt, &timer);
|
||||||
Hour = bt.tm_hour;
|
Hour = bt.tm_hour;
|
||||||
Min = bt.tm_min;
|
Min = bt.tm_min;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user