6
A
回答
9
认沽日期延长
{{ value.time.date }}
3
>>> from datetime import datetime,date
>>> date_str = 'March 22, 2013, 2:30 a.m'
>>> date_str = date_str.replace('a.m','AM')
>>> formatter_string = "%B %d, %Y, %I:%M %p"
>>> datetime_object = datetime.strptime(date_str, formatter_string)
>>> date_object = datetime_object.date() # date object without '2:30 AM'
>>> date_object
datetime.date(2013, 3, 22)
>>> formatter_string = "%B %d, %Y"
>>> datetime_string = datetime.strftime(date_object, formatter_string)
>>> datetime_string
'March 22, 2013'
相关问题
- 1. 从时间和日期删除时间
- 2. 从日期删除时间
- 3. 从pandas数据框中的日期时间删除时间戳
- 4. Python - 日期时间函数
- 5. PHP日期时间函数
- 6. 日期时间函数PHP
- 7. 删除时间格式的日期
- 8. 日期时间函数转换一个日期旧时间
- 9. MySQL日期时间和当前日期时间函数
- 10. 日期/时间在甲骨文 - 日期时间函数
- 11. MySQL的删除其日期时间最近的系统时间
- 12. 从django的日期时间格式中删除时间
- 13. 用日期时间函数删除旧文件夹
- 14. 从日期时间中扣除时间
- 15. MySQL删除日期和时间比较
- 16. 从日期格式中删除时间
- 17. 蟒蛇 - 删除日期和时间
- 18. Python Pandas Groupby删除日期时间列
- 19. SQL日期时间查询删除秒
- 20. 如何从日期删除时间
- 21. java.util.logging:删除日期时间行
- 22. 删除日期时间由strftime
- 23. Python Dataframe.resample()从日期时间索引中删除时间
- 24. 如何防止hibernate从日期时间中删除时间?
- 25. 使用jQuery从日期/时间字符串中删除时间
- 26. 排除SSRS报告的“日期/时间”参数中的时间
- 27. CLIPS中的时间和日期函数
- 28. PHP的日期时间函数
- 29. python pandas:计算时间段的日期/时间函数
- 30. java日期扣除小时 - 两小时之间的期间
如何[的strftime()](http://docs.python.org/2/library/time.html#time.strftime)? – 2013-03-22 09:48:20