【问题标题】:How to find out the week number given a date in Python? [duplicate]如何在Python中找出给定日期的周数? [复制]
【发布时间】:2012-10-29 07:17:39
【问题描述】:

我有一个Fri Oct 02 19:52:02 +0000 2009 格式的日期。我需要在 Python 中找到与此日期对应的周数。我是 Python 新手,我不知道 datetime 有一个功能可以让我找到它。

【问题讨论】:

标签: python datetime


【解决方案1】:

time.strftime 具有 %U(周数)参数。

【讨论】:

    猜你喜欢
    • 2020-12-01
    • 2012-03-23
    • 2014-07-15
    • 2020-11-17
    • 1970-01-01
    • 1970-01-01
    • 2011-09-26
    • 2021-07-17
    • 2013-10-13
    相关资源
    最近更新 更多