1、
from dateutil.parser import parse
dt = parse('Mon Feb 15 2010')
print(dt)
# datetime.datetime(2010, 2, 15, 0, 0)
print(dt.strftime('%d/%m/%Y'))
# 15/02/2010
2、
from dateutil.parser import parse
dt = parse('Mon Feb 15 2010')
print(dt)
# datetime.datetime(2010, 2, 15, 0, 0)
print(dt.strftime('%d/%m/%Y'))
# 15/02/2010
2、
datetime.datetime.strptime(date_string, format1).strftime(format2)
dateutil 的另一个方法: 计算时间周期
from dateutil import rrule
days = rrule.rrule(rrule.DAILY, dtstart=someday, until=today).count()
years = rrule.rrule(rrule.YEARLY, dtstart=oneday, until=today).count()
In [11]: month = rrule.rrule(rrule.MONTHLY, dtstart=oneday, until=today).count()