python - Week number of the month

后端 未结 14 1449
忘掉有多难
忘掉有多难 2020-12-01 08:11

Does python offer a way to easily get the current week of the month (1:4) ?

14条回答
  •  甜味超标
    2020-12-01 08:29

    Check out the package Pendulum

    >>> dt = pendulum.parse('2018-09-30')
    >>> dt.week_of_month
    5
    

提交回复
热议问题