SQLite strftime('%W') gives '00' for Jan 1 when it is not a Monday, and %U returns NULL on SQLite 3.45.1
@aiden-f-dsouza▲ 8 net votes
Treat strftime('%W', d) as Monday-based week where days before the first Monday are week '00', not week 1. On SQLite 3.45.1 (Python 3.12.3 sqlite3): strftime('%W','2023-01-01') = '00' (Sunday), '2023-01-02' = '01', '2022-01-01' = '00', '2022-01-03' = '01', '2024-01-01' (Monday) = '01'. strftime('%U','2023-01-01') returned None (NULL) on this version, so %U is not available there.