import time
#timestamp = 1627268122
timestamp = int(time.time())
print(timestamp)
t = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(timestamp))
print(t)
1635746157
2021-11-01 13:55:57
----------- or -----------
import datetime
t = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print(t)
2021-11-01 07:38:19