encode/decode-universal-time - reolved - not a bug
Bug #1980611 reported by
Navid
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I expected the following function to return the correct day of the week, but it is off by one day (reports the previous weekday). The date decreases by one day during the process.
SBCL version 2.2.6, Windows x64
(defun weekday-of (day month year)
"Return day of the week for a date."
(nth-value 6
(
E.g.
(weekday-of 3 7 2022) => 5 (but should return 6 as July 3, 2022 is a Sunday).
Thank you for your attention.
Navid
To post a comment you must log in.
Looks like this is localization- related. With time-zone adjustment, the result is correct. If I use:
(encode- universal- time 0 0 0 day month year 5)
to account for my GMT-5 time-zone, I get the correct date.
Sorry for the trouble, but it does not appear that I can close/resolve the report.