1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

time: fix iso8601 parser and utc time

This commit is contained in:
Tomas Hellström
2020-06-10 11:14:55 +02:00
committed by GitHub
parent 8f9f426479
commit 2dc547a45c
10 changed files with 255 additions and 88 deletions

View File

@@ -161,8 +161,23 @@ fn test_now() {
assert now.minute >= 0
assert now.minute < 60
assert now.second >=0
assert now.second < 60
assert now.second <= 60 // <= 60 cause of leap seconds
assert now.microsecond >= 0
assert now.microsecond < 1000000
}
fn test_utc() {
now := time.utc()
// The year the test was built
assert now.year >= 2020
assert now.month > 0
assert now.month <= 12
assert now.minute >= 0
assert now.minute < 60
assert now.second >=0
assert now.second <= 60 // <= 60 cause of leap seconds
assert now.microsecond >= 0
assert now.microsecond < 1000000
}