how to convert epoch to time by assigning a particular epoch value to it. tried assigning values to a and calling it. couldnt able to do it.
import datetime
a=1529396478000
datetime.datetime.fromtimestamp(a).strftime('%c')
how to convert epoch to time by assigning a particular epoch value to it. tried assigning values to a and calling it. couldnt able to do it.
import datetime
a=1529396478000
datetime.datetime.fromtimestamp(a).strftime('%c')
import datetime
a=1529396478000
a /= 1000
print(datetime.datetime.utcfromtimestamp(a).strftime('%Y-%m-%d %H:%M:%S'))
try datetime.datetime.fromtimestamp(a).strftime('%Y-%m-%d %H:%M:%S')
I think a is missing a dot, a=1529396478.000 otherwise the year is 50434 resulting in a ValueError.