I'm trying to format a timestamp 1584474718199
to date but it gives me wrong date. This is what I'm getting 2020-03-18
at this moment whereas the correct date shhould be 2020-03-17
. How can I achive that?
My current approach:
from datetime import datetime
timestamp = 1584474718199/1000
dt_object = datetime.fromtimestamp(timestamp)
print(f"{dt_object:%Y-%m-%d}")