Joe*_*oel 4 python datetime date-format
我将datetime.datetime.now()保存为字符串.现在我有一个字符串值,即
2010-10-08 14:26:01.220000
Run Code Online (Sandbox Code Playgroud)
如何将此字符串转换为
Oct 8th 2010
Run Code Online (Sandbox Code Playgroud)
?
谢谢
from datetime import datetime
datetime.strptime('2010-10-08 14:26:01.220000'[:-7],
'%Y-%m-%d %H:%M:%S').strftime('%b %d %Y')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
277 次 |
| 最近记录: |