Add fromWinTime and deprecate unixTimeToWinTime/winTimeToUnixTime (#7641)
This commit is contained in:
parent
7e15d5134b
commit
7d034d7b6a
3 changed files with 40 additions and 22 deletions
|
|
@ -409,4 +409,11 @@ suite "ttimes":
|
|||
# Bug with adding a day to a Time
|
||||
let day = 24.hours
|
||||
let tomorrow = now + day
|
||||
check tomorrow - now == initDuration(days = 1)
|
||||
check tomorrow - now == initDuration(days = 1)
|
||||
|
||||
test "fromWinTime/toWinTime":
|
||||
check 0.fromUnix.toWinTime.fromWinTime.toUnix == 0
|
||||
check (-1).fromWinTime.nanoseconds == convert(Seconds, Nanoseconds, 1) - 100
|
||||
check -1.fromWinTime.toWinTime == -1
|
||||
# One nanosecond is discarded due to differences in time resolution
|
||||
check initTime(0, 101).toWinTime.fromWinTime.nanoseconds == 100
|
||||
Loading…
Add table
Add a link
Reference in a new issue