summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Timer.cpp
diff options
context:
space:
mode:
authorChris Burgener <christhecoolist@gmail.com>2016-07-19 11:55:46 -0400
committerGitHub <noreply@github.com>2016-07-19 11:55:46 -0400
commite32af8e0fea9cf79d04836089d5018ed38b1d095 (patch)
tree85992697617c04b1f9bd8302f80b5c611d01317c /Source/Core/Common/Timer.cpp
parentfb723602831a73dc5952d1a3a4421fdf634c0139 (diff)
parentcac9516e399c1ade4c96f5fa1e6f571081175332 (diff)
Merge pull request #4007 from RisingFog/configurable_rtc
Add Configurable RTC options
Diffstat (limited to 'Source/Core/Common/Timer.cpp')
-rw-r--r--Source/Core/Common/Timer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/Source/Core/Common/Timer.cpp b/Source/Core/Common/Timer.cpp
index edd1d4b378..752664c1b6 100644
--- a/Source/Core/Common/Timer.cpp
+++ b/Source/Core/Common/Timer.cpp
@@ -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