summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/Timer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/Src/Timer.cpp')
-rw-r--r--Source/Core/Common/Src/Timer.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/Core/Common/Src/Timer.cpp b/Source/Core/Common/Src/Timer.cpp
index 039770ebd7..67bb6874b4 100644
--- a/Source/Core/Common/Src/Timer.cpp
+++ b/Source/Core/Common/Src/Timer.cpp
@@ -174,15 +174,23 @@ u64 Timer::GetTimeSinceJan1970()
u64 Timer::GetLocalTimeSinceJan1970()
{
- time_t sysTime, tzDiff;
+ time_t sysTime, tzDiff, tzDST;
struct tm * gmTime;
time(&sysTime);
+
+ // Account for DST where needed
+ gmTime = localtime(&sysTime);
+ if(gmTime->tm_isdst == 1)
+ tzDST = 3600;
+ else
+ tzDST = 0;
+
// Lazy way to get local time in sec
gmTime = gmtime(&sysTime);
tzDiff = sysTime - mktime(gmTime);
- return (u64)(sysTime + tzDiff);
+ return (u64)(sysTime + tzDiff + tzDST);
}
// Return the current time formatted as Minutes:Seconds:Milliseconds