Flexible English date phrase library for Python?

牧云@^-^@ 提交于 2019-12-29 09:58:28

问题


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):

  • 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?


回答1:


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




回答2:


I think the best bet here would be the mxDateTime. The documentation seems to suggest that it does what you're looking for.



来源:https://stackoverflow.com/questions/4458705/flexible-english-date-phrase-library-for-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!