How to calculate next Friday?

前端 未结 7 1970
失恋的感觉
失恋的感觉 2020-12-13 13:34

How can I calculate the date of the next Friday?

7条回答
  •  没有蜡笔的小新
    2020-12-13 14:18

    I found this pendulum pretty useful. Just one line

    >>> pendulum.now().next(pendulum.FRIDAY).strftime('%Y-%m-%d')
    '2019-04-26'
    

提交回复
热议问题