If it's microseconds then you can convert them to seconds, and use fromtimestamp()
to convert seconds since the UNIX epoch to a datetime
object.
This is explained in this answer to the question How to convert microsecond timestamp to readable date?
import datetime
timestamp_microseconds = 1396752197709867
timestamp_seconds = timestamp_microseconds/1000000
dobj = datetime.datetime.fromtimestamp(timestamp_seconds)
print(dobj.isoformat()) # -> 2014-04-05T19:43:17.709867
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.