人类的日期
human_dates的Python项目详细描述
人类约会
==
我来自ruby/rails世界,我错过了一些约会糖。我并没有一直抱怨它,我想我应该做些什么来解决它,它提供了两套功能:
。最重要的是它有一个很好的“time ago”功能。有一些自然语言可以到达事情的开始和结束
代码块::bash
$pip安装人工日期
time\u ago\u in\u words用法
----
代码块::python
from human_dates import time_ago_in_words,start_of_day
print time_ago_in_words()
代码块:python
from human_dates import*
print start_of_day()
print start_of_hour()
print start_of_year()
print end_of_month()
等等….
日期时间
datetime=datetime.strrptime('2008年2月13日1:33p m',%b%d%y%y%y%i%m%p')
result=hu人日期。月底(日期)
打印结果
2008-02-29 2008-02-23:59:59.99999
-delorean:http://delorean.readthedocs.org/en/latest/quickstart.html(<;--请在这之前看一下这个,请在这之前看一下。是的使用人工日期。
对我来说是重量级的,但可能对你很好)
其他重要的时间库
-dateutil:http://labix.org/python dateutil
-pytz:http://pytz.sourceforge.net/
==
我来自ruby/rails世界,我错过了一些约会糖。我并没有一直抱怨它,我想我应该做些什么来解决它,它提供了两套功能:
。最重要的是它有一个很好的“time ago”功能。有一些自然语言可以到达事情的开始和结束
代码块::bash
$pip安装人工日期
time\u ago\u in\u words用法
----
代码块::python
from human_dates import time_ago_in_words,start_of_day
print time_ago_in_words()
代码块:python
from human_dates import*
print start_of_day()
print start_of_hour()
print start_of_year()
print end_of_month()
等等….
日期时间
datetime=datetime.strrptime('2008年2月13日1:33p m',%b%d%y%y%y%i%m%p')
result=hu人日期。月底(日期)
打印结果
2008-02-29 2008-02-23:59:59.99999
-delorean:http://delorean.readthedocs.org/en/latest/quickstart.html(<;--请在这之前看一下这个,请在这之前看一下。是的使用人工日期。
对我来说是重量级的,但可能对你很好)
其他重要的时间库
-dateutil:http://labix.org/python dateutil
-pytz:http://pytz.sourceforge.net/