Code: Select all
def daysb4(time):
sts, now = SYS.gettim()
if (sts & 1) == 1: # if sucessfully got current time
sts, time_since = SYS.asctim(time - now, 0) # convert time to string delta time before now
if (sts & 1) == 1:
days_since = 0 + time_since.split("+") # extract the days
return days_since
else:
return 99999 # indicate error by returning number bigger than any valid delta time
#endif
#end daysb4
Code: Select all
OverflowError: can't convert negative int to unsigned
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/DATA/IMILLER/PY/fh2.py", line 295, in <module>
print("rev days b4",daysb4(fi.revdate))
File "/DATA/IMILLER/PY/fh2.py", line 237, in daysb4
sts, time_since = SYS.asctim(time - now, 0) # convert time to string delta time before now
SystemError: <built-in function asctim> returned a result with an exception set