开发者

convert string to datetime in python [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Convert string to datetime in django?

how to convert time string like '18:30:00' into datetime 开发者_StackOverflow中文版in python?


Use the datetime.datetime.strptime() method


My post in Daniweb:
Date string to date object, seconds to readable string

You seem to only consider time part, it is trivial to convert by simple split.


http://docs.python.org/library/time.html#time.strptime

That is the best way to do it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜