开发者

convert string to datetime in python [duplicate]

开发者 https://www.devze.com 2023-02-26 19:23 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Convert string to datetime in django?
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

精彩评论

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