问题描述
我是python的新手,我想知道是否有任何智能的
日期/时间解析模块。我已经从eGenix软件包中查看了strptime(或
,无论哪个)和mxDateTime。我需要
来解析django应用程序的用户输入,而且很棒的是
能够写出last monday,一年前 ;或周二晚上10点;喜欢
PHP'的strtotime。
那么有没有允许这种解析的模块?
I''m new to python and I was wondering if there are any intelligent
date/time parsing modules out there. I''ve looked at strptime (or
whichever it is) and mxDateTime from the eGenix package. I need
something to parse user input for a django app, and it''s awesome to be
able to write "last monday", "a year ago", or "10pm tuesday" like
PHP''s strtotime.
So are there any modules that allow for that kind of parsing?
推荐答案
有一个dateutil模块,它是日期时间
模块的花哨包装器。作者的网站有很多例子和来源:
我用了很多。
HTH
Mike
There''s the dateutil module that''s a fancy wrapper for the datetime
module. The author''s site has lots of examples as well as the source:
http://labix.org/python-dateutil
I use it quite a bit.
HTH
Mike
我忘了说,提前谢谢,我很感激你能给我的任何
方向! (对我来说多么粗鲁!)
- Jacob Alheid
I forgot to say, thanks ahead of time, and I''d appreciate any
direction that you can give me! (How rude of me!)
- Jacob Alheid
有一个dateutil模块,它是日期时间
模块的花哨包装器。作者的网站有很多例子和来源:
我用了很多。
HTH
迈克
There''s the dateutil module that''s a fancy wrapper for the datetime
module. The author''s site has lots of examples as well as the source:
http://labix.org/python-dateutil
I use it quite a bit.
HTH
Mike
神圣的垃圾很快。我会检查出来 - 感谢您的帮助!
Jacob
Holy Crap that was fast. I''ll check it out - thanks for the help!
Jacob
这篇关于智能日期&时间解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!