mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
time: turn Time.unix to i64, so it can represent times before 1970-01-01, fix time operators, add more tests (#11050)
This commit is contained in:
@ -131,9 +131,9 @@ pub fn parse_iso8601(s string) ?Time {
|
||||
}
|
||||
mut unix_time := t.unix
|
||||
if unix_offset < 0 {
|
||||
unix_time -= u64(-unix_offset)
|
||||
unix_time -= (-unix_offset)
|
||||
} else if unix_offset > 0 {
|
||||
unix_time += u64(unix_offset)
|
||||
unix_time += unix_offset
|
||||
}
|
||||
t = unix2(i64(unix_time), t.microsecond)
|
||||
return t
|
||||
|
Reference in New Issue
Block a user