(d)
| 8 | const pad = (n, w = 2) => String(n).padStart(w, "0"); |
| 9 | // CPython tm_wday is Mon=0..Sun=6; JS getDay is Sun=0. Convert both ways. |
| 10 | const cpyWday = (d) => (d + 6) % 7; |
| 11 | const jsDay = (cpy) => (cpy + 1) % 7; |
| 12 | |
| 13 | // Date -> struct_time JSON, CPython order (Y, m, d, H, M, S, wday, yday, isdst). |