智能日期&时间解析 [英] Intelligent Date & Time parsing

查看:84
本文介绍了智能日期&时间解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是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?

推荐答案

3月7日下午4:08,shak ... @ gmail.com写道:
On Mar 7, 4:08 pm, shak...@gmail.com wrote:

我是新手到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模块,它是日期时间

模块的花哨包装器。作者的网站有很多例子和来源:

http://labix.org/python-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


3月7日下午4:08,shak ... @ gmail.com写道:
On Mar 7, 4:08 pm, shak...@gmail.com wrote:

我是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?



我忘了说,提前谢谢,我很感激你能给我的任何

方向! (对我来说多么粗鲁!)


- 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


3月7日下午4:10,Mike Driscoll< kyoso ... @ gmail.comwrote:
On Mar 7, 4:10 pm, Mike Driscoll <kyoso...@gmail.comwrote:

3月7日下午4:08,shak ... @ gmail.com写道:
On Mar 7, 4:08 pm, shak...@gmail.com wrote:

我是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模块,它是日期时间

模块的花哨包装器。作者的网站有很多例子和来源:

http://labix.org/python-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


这篇关于智能日期&amp;时间解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆