Skip to content

Commit

Permalink
fix timezone in initDateTime for ISO week date (nim-lang#22090)
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn authored and bung87 committed Jul 29, 2023
1 parent 3f3718a commit 9089ad5
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 9089ad5

Please sign in to comment.