Convert Epoch Time to Datetime in Python

 import datetime


epoch_time = 1541290680

result_datetime = datetime.datetime.fromtimestamp(epoch_time)

print(result_datetime) 

#prints 2018-11-04 12:18:00


or alternatively, if you're in rush, head to online epoch converter here


the above code is modified from: https://www.javatpoint.com/python-epoch-to-datetime

Comments

Popular posts from this blog

Adding a Dashed Connector in Draw.io

DBeaver / PostgreSQL: "Error: database already exists" Workaround

How to Get The Replication Factor of HDFS Files