2019-04-08

timestamp转date

import time
import datetime
a = int(round(time.time()*1000))
b = time.localtime(float(a/1000))
c = time.strftime('%Y-%m-%d', b)
d = datetime.datetime.strptime(c, '%Y-%m-%d')
print(d)

你可能感兴趣的:(2019-04-08)