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

time: fix calculate_date_from_offset (#14399)

This commit is contained in:
David 'Epper' Marshall
2022-05-15 03:55:24 -04:00
committed by GitHub
parent b50f7fdc71
commit c28051020a
5 changed files with 58 additions and 65 deletions

View File

@ -184,3 +184,17 @@ fn test_parse_rfc3339() {
assert expected == output
}
}
fn test_ad_second_to_parse_result_in_2001() ? {
now_tm := time.parse('2001-01-01 04:00:00')?
future_tm := now_tm.add_seconds(60)
assert future_tm.str() == '2001-01-01 04:01:00'
assert now_tm.unix < future_tm.unix
}
fn test_ad_second_to_parse_result_pre_2001() ? {
now_tm := time.parse('2000-01-01 04:00:00')?
future_tm := now_tm.add_seconds(60)
assert future_tm.str() == '2000-01-01 04:01:00'
assert now_tm.unix < future_tm.unix
}