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

time: fix parse_format with YY (#18887)

This commit is contained in:
Turiiya
2023-07-18 01:05:49 +02:00
committed by GitHub
parent 2eea59c4cc
commit bf98f7c9ee
2 changed files with 3 additions and 4 deletions

View File

@ -163,7 +163,7 @@ fn (mut p DateTimeParser) parse() !Time {
}
}
'YY' {
year_ = p.must_be_int(2) or {
year_ = now().year / 100 * 100 + p.must_be_int(2) or {
return error_invalid_time(0, 'end of string reached before the full year was specified')
}
}