○ python time.py
Traceback (most recent call last):
File "time.py", line 6, in <module>
print (timeago.format(date, now, locale='zh_CN')) # will print <removed because encoding>
NameError: name 'date' is not defined
.
○ python time.py
Traceback (most recent call last):
File "time.py", line 9, in <module>
print (timeago.format(date, now)) # will print 3 minutes ago
NameError: name 'date' is not defined
.
○ python time.py
Traceback (most recent call last):
File "time.py", line 12, in <module>
print (timeago.format(datetime.timedelta(seconds = 60 * 3.4))) # will print 3 minutes ago
File "/usr/lib/python2.6/site-packages/timeago/__init__.py", line 25, in format
diff_seconds = date.total_seconds()
AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'
.
○ python time.py
Traceback (most recent call last):
File "time.py", line 15, in <module>
print (timeago.format(datetime.date(2016, 5, 27), now))
File "/usr/lib/python2.6/site-packages/timeago/__init__.py", line 33, in format
raise ParameterUnvalid('the parameter `date` should be datetime / timedelta, or datetime formated string.')
timeago.excepts.ParameterUnvalid: 'the parameter `date` should be datetime / timedelta, or datetime formated string.'
.
○ python time.py
Traceback (most recent call last):
File "time.py", line 18, in <module>
print (timeago.format(datetime.date(2016, 5, 27), now))
File "/usr/lib/python2.6/site-packages/timeago/__init__.py", line 33, in format
raise ParameterUnvalid('the parameter `date` should be datetime / timedelta, or datetime formated string.')
timeago.excepts.ParameterUnvalid: 'the parameter `date` should be datetime / timedelta, or datetime formated string.'
.
○ python time.py
Traceback (most recent call last):
File "time.py", line 21, in <module>
print (timeago.format('2016-05-27 12:12:12', '2016-05-27 12:12:03')) # will print just now
File "/usr/lib/python2.6/site-packages/timeago/__init__.py", line 37, in format
diff_seconds = (now - date).total_seconds()
AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'
.
.
.
.
.
.