【发布时间】:2012-01-11 18:20:13
【问题描述】:
我有我的 django 对象的日期时间,但它可以是一天中的任何时间。可以是一天中的任何时间,但我需要将时间设置为 00:00:00(另一个日期设置为 23:59:59,但原则相同)
end_date = lastItem.pub_date
目前结束日期为 2002-01-11 12:34:56 我需要做什么才能将其更改为 00:00:00?
我试过了:
end_date.hour = '00'
但得到:'datetime.datetime' 对象属性 'time' 是只读的
【问题讨论】:
-
你需要一个初始化为 00:00:00 的日期时间变量吗?
标签: python django date datetime date-manipulation