import time
time.strftime("%W")
#输出 5
#今天 2-7 号不是第七工作周吗?
#日历上工作周是第七周,我用 dayjs 也是输出 7,python 输出是 5 !
import time
time.strftime("%W")
#输出 5
#今天 2-7 号不是第七工作周吗?
#日历上工作周是第七周,我用 dayjs 也是输出 7,python 输出是 5 !
|
welkinzhFeb 7, 2021
1
?
|
|
2
@welkinzh 日历上工作周是第七周,我用 dayjs 也是输出 7,python 输出是 5 !
|
|
welkinzhFeb 7, 2021
3
看了一下日历,py 中新年第一周是从第一个周一开始的,确实是第 5 周
|
|
okletswinFeb 7, 2021
4
说明你那个日历够过分的,把去年最后一周算成今年的,还莫非外国习惯把周日当作每周第一天。明天才是第六周
|
|
5
规则不同而已
1. %W 按 Monday 起始计算,%U 按 Sunday 起始计算 2. 返回结果首序是 0,不是 1 |
|
estFeb 7, 2021
6
https://strftime.org/
Week number of the year (Monday as the first day of the week) as a decimal number. All days in a new year preceding the first Monday are considered to be in week 0. |
|
momo1999Feb 7, 2021
7
|