1from datetime import datetime
2
3timestamp = 1586507536367
4dt_object = datetime.fromtimestamp(timestamp)
5
1import time
2timestamp = 1547281745
3datetime = time.strftime('%A, %Y-%m-%d %H:%M:%S', time.localtime(timestamp))
4print(datetime)
1import time
2ts = time.time()
3// OR
4import datetime;
5ct = datetime.datetime.now()
6ts = ct.timestamp()
1import datetime
2from datetime import datetime
3timestamp = pd.Timestamp('2020-5-23')