import time a = [1462636800, 1606492800] print(time.time()-86400*4) for item in a: print(time.strftime('%Y-%m-%d',time.localtime(1606377029)))