I am trying to convert time stamp to human date. i am doing that in order to get the local time of a message and insert it into our database as human date.
currently if i use the following code:
from datetime import datetime, timedelta
reference_date1 = datetime(2001, 1, 1, 0, 0, 0)
delta_since_reference = timedelta(seconds=530023775)
print str(reference_date1 + delta_since_reference)
i get:
2017-10-18 12:49:35
which there the date is correct but the hour is wrong. and if i use:
print datetime.fromtimestamp(530023775)
i get:
1986-10-18 14:49:35
which here the hour is correct but the year is wrong. there is a way to merge between the 2 results? or there is a better approach to convert time stamp?