Skip to content

Commit 1d32607

Browse files
authored
Allow parsing year "00" with "yy" pattern (#24785)
The "yy" pattern is relative to the current century, so year "00" should be valid.
1 parent 7c5d005 commit 1d32607

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

lib/pure/times.nim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,6 @@ proc parsePattern(input: string, pattern: FormatPattern, i: var int,
20162016
var year = takeInt(2..2)
20172017
var thisCen = now().year div 100
20182018
parsed.year = some(thisCen*100 + year)
2019-
result = year > 0
20202019
of yyyy:
20212020
let year =
20222021
if input[i] in {'+', '-'}:

0 commit comments

Comments
 (0)