适用于Python的灵活的英文日期库? [英] Flexible English date phrase library for Python?

查看:150
本文介绍了适用于Python的灵活的英文日期库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个可以将英文日期短语转换为表示适当日期的某种Python日期对象的函数。

I'm looking for a function that can convert an English date phrase to some kind of Python date object representing the appropriate date.

我正在寻找的东西(虽然我很灵活):

An example of the kinds of things I'm looking for (though I'm flexible):


  • 三天以后

  • 昨天

  • 在一个月内

  • 明年

  • 2011年1月18日

  • 下周三

  • Three days from now
  • yesterday
  • In a month
  • Next year
  • January 18, 2011
  • Next Wednesday

有没有这样的事情?有没有另一种语言可以使用?

Is there such a thing? Is there one perhaps in another language?

推荐答案

parsedatetime,总是经典的: http://code.google.com/p/parsedatetime/

parsedatetime, always a classic: http://code.google.com/p/parsedatetime/

这篇关于适用于Python的灵活的英文日期库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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