Convert Unix timestamp to date

  • by

Python script

from datetime import datetime 

converted_to_date = datetime.utcfromtimestamp(1575389290) 

# print result 
print(converted_to_date) 

# convert date format 
print(converted_to_date.strftime("%d.%m.%Y %H:%M:%S"))

Output

2019-12-03 16:08:10
03.12.2019 16:08:10

The unix timestamp is a 10 digit number, which tells how many seconds since January 01 1970 (UTC) have passed.

Tags: