Comparing datetimes
This commit is contained in:
parent
455dd36135
commit
759023e157
2 changed files with 21 additions and 1 deletions
|
|
@ -367,4 +367,12 @@ suite "ttimes":
|
|||
check $(dt - 1.months) == "2017-02-15T00:00:00+00:00"
|
||||
dt = initDateTime(31, mMar, 2017, 00, 00, 00, utc())
|
||||
# This happens due to monthday overflow. It's consistent with Phobos.
|
||||
check $(dt - 1.months) == "2017-03-03T00:00:00+00:00"
|
||||
check $(dt - 1.months) == "2017-03-03T00:00:00+00:00"
|
||||
|
||||
test "compare datetimes":
|
||||
var dt1 = now()
|
||||
var dt2 = dt1
|
||||
check dt1 == dt2
|
||||
check dt1 <= dt2
|
||||
dt2 = dt2 + 1.seconds
|
||||
check dt1 < dt2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue