mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 04:38:49 +00:00
Add Configurable RTC
This commit is contained in:
parent
e21cc8937b
commit
cac9516e39
10 changed files with 148 additions and 5 deletions
|
@ -178,12 +178,10 @@ u64 Timer::GetTimeSinceJan1970()
|
|||
u64 Timer::GetLocalTimeSinceJan1970()
|
||||
{
|
||||
time_t sysTime, tzDiff, tzDST;
|
||||
struct tm* gmTime;
|
||||
|
||||
time(&sysTime);
|
||||
tm* gmTime = localtime(&sysTime);
|
||||
|
||||
// Account for DST where needed
|
||||
gmTime = localtime(&sysTime);
|
||||
if (gmTime->tm_isdst == 1)
|
||||
tzDST = 3600;
|
||||
else
|
||||
|
@ -193,7 +191,7 @@ u64 Timer::GetLocalTimeSinceJan1970()
|
|||
gmTime = gmtime(&sysTime);
|
||||
tzDiff = sysTime - mktime(gmTime);
|
||||
|
||||
return (u64)(sysTime + tzDiff + tzDST);
|
||||
return static_cast<u64>(sysTime + tzDiff + tzDST);
|
||||
}
|
||||
|
||||
// Return the current time formatted as Minutes:Seconds:Milliseconds
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue