diff options
-rw-r--r-- | lib/pure/times.nim | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim index 1767a37be..248d397a7 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -514,14 +514,6 @@ when not defined(JS): # copying is needed anyway to provide reentrancity; thus # the conversion is not expensive - proc timeInfoToTime(timeInfo: TimeInfo): Time = - var cTimeInfo = timeInfo # for C++ we have to make a copy, - # because the header of mktime is broken in my version of libc - 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 toTime(timeInfo: TimeInfo): Time = var cTimeInfo = timeInfo # for C++ we have to make a copy, # because the header of mktime is broken in my version of libc @@ -530,6 +522,8 @@ when not defined(JS): # does ignore the timezone, we need to adjust this here. result = Time(TimeImpl(result) - getTimezone() + timeInfo.timezone) + proc timeInfoToTime(timeInfo: TimeInfo): Time = toTime(timeInfo) + const epochDiff = 116444736000000000'i64 rateDiff = 10000000'i64 # 100 nsecs |