将字符串转换为日期时间 - Converting string into datetime

问题:

I've got a huge list of date-times like this as strings: 我有大量的日期时间列表,例如字符串: 数据库

Jun 1 2005  1:33PM
Aug 28 1999 12:00AM

I'm going to be shoving these back into proper datetime fields in a database so I need to magic them into real datetime objects. 我将把它们推回到数据库中正确的日期时间字段中,所以我须要将它们魔术化为实际的日期时间对象。 this

This is going through Django's ORM so I can't use SQL to do the conversion on insert. 这是经过Django的ORM进行的,所以我没法使用SQL进行插入时的转换。 spa


解决方案:

参考一: https://stackoom.com/question/1xJh/将字符串转换为日期时间
参考二: https://oldbug.net/q/1xJh/Converting-string-into-datetime
相关文章
相关标签/搜索