SP/web2py/gluon/contrib/pymysql/times.py
Saturneic 064f602b1a Add.
2018-10-25 23:33:13 +08:00

21 lines
360 B
Python

from time import localtime
from datetime import date, datetime, time, timedelta
Date = date
Time = time
TimeDelta = timedelta
Timestamp = datetime
def DateFromTicks(ticks):
return date(*localtime(ticks)[:3])
def TimeFromTicks(ticks):
return time(*localtime(ticks)[3:6])
def TimestampFromTicks(ticks):
return datetime(*localtime(ticks)[:6])