Skip to content

Commit

Permalink
fix timezone in initDateTime for ISO week date (#22090)
Browse files Browse the repository at this point in the history
fixes #22059
  • Loading branch information
metagn committed Jun 13, 2023
1 parent 894a19c commit 20dfdba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pure/times.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ proc initDateTime*(weekday: WeekDay, isoweek: IsoWeekRange, isoyear: IsoYear,
assert initDateTime(2, mJan, 2021, 00, 00, 00) == initDateTime(dSat, 53, 2020.IsoYear, 00, 00, 00)

# source https://webspace.science.uu.nl/~gent0113/calendar/isocalendar.htm
let d = isoweek * 7 + weekday.int - initDateTime(4, mJan, isoyear.int, 00, 00, 00).weekday.int - 4
let d = isoweek * 7 + weekday.int - initDateTime(4, mJan, isoyear.int, 00, 00, 00, zone).weekday.int - 4
initDateTime(1, mJan, isoyear.int, hour, minute, second, nanosecond, zone) + initDuration(days=d)

proc initDateTime*(weekday: WeekDay, isoweek: IsoWeekRange, isoyear: IsoYear,
Expand Down

0 comments on commit 20dfdba

Please sign in to comment.