summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-01-07 00:27:53 +0100
committerGitHub <noreply@github.com>2017-01-07 00:27:53 +0100
commitedf2a57a70486306054892dfc6cec77afcbb532f (patch)
tree1589aab8b373242c796503cfd9cfedc1aa2abb5b
parent7c8563b8ddc677e49553a3de591f0ebf2e5e9257 (diff)
parent45c251cb1d5da8e1becfc64b616569290594b1b4 (diff)
downloadNim-edf2a57a70486306054892dfc6cec77afcbb532f.tar.gz
Merge pull request #5188 from trustable-code/patch-2
fixes #4804
-rw-r--r--lib/pure/times.nim14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index 39d46c675..82fc9ad41 100644
--- a/lib/pure/times.nim
+++ b/lib/pure/times.nim
@@ -523,16 +523,10 @@ when not defined(JS):
     var cTimeInfo = timeInfo # for C++ we have to make a copy
     # because the header of mktime is broken in my version of libc
 
-    when defined(windows):
-      # On Windows `mktime` is broken enough to make this work.
-      result = mktime(timeInfoToTM(cTimeInfo))
-      # mktime is defined to interpret the input as local time. As timeInfoToTM
-      # does ignore the timezone, we need to adjust this here.
-      result = Time(TimeImpl(result) - getTimezone() + timeInfo.timezone)
-    else:
-      result = timegm(timeInfoToTM(cTimeInfo))
-      # As timeInfoToTM does ignore the timezone, we need to adjust this here.
-      result = Time(TimeImpl(result) + timeInfo.timezone)
+    result = mktime(timeInfoToTM(cTimeInfo))
+    # mktime is defined to interpret the input as local time. As timeInfoToTM
+    # does ignore the timezone, we need to adjust this here.
+    result = Time(TimeImpl(result) - getTimezone() + timeInfo.timezone)
 
   proc timeInfoToTime(timeInfo: TimeInfo): Time = toTime(timeInfo)