diff options
Diffstat (limited to 'lib/pure/times.nim')
-rw-r--r-- | lib/pure/times.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim index 3142952e7..a478b9d65 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -439,7 +439,9 @@ when not defined(JS): proc getTime(): Time = return timec(nil) proc getLocalTime(t: Time): TimeInfo = var a = t - result = tmToTimeInfo(localtime(addr(a))[], true) + let lt = localtime(addr(a)) + assert(not lt.isNil) + result = tmToTimeInfo(lt[], true) # copying is needed anyway to provide reentrancity; thus # the conversion is not expensive |