[ create a new paste ] login | about

Link: http://codepad.org/hPRC7LhS    [ raw code | output | fork ]

Python, pasted on Mar 26:
1
2
3
4
5
6
7
8
9
10
11
12
from time import time, mktime
from datetime import datetime, timedelta

ts = time()

ts_xday = mktime(datetime.strptime('2038/1/15', '%Y/%m/%d').timetuple())
delta1 = timedelta(seconds=(ts_xday - ts))
print delta1

ts_xday = mktime(datetime.strptime('2038/1/20', '%Y/%m/%d').timetuple())
delta1 = timedelta(seconds=(ts_xday - ts))
print delta1


Output:
1
2
3
4
5
7599 days, 9:17:03.664190
Traceback (most recent call last):
  Line 10, in <module>
    ts_xday = mktime(datetime.strptime('2038/1/20', '%Y/%m/%d').timetuple())
OverflowError: mktime argument out of range


Create a new paste based on this one


Comments: