简体   繁体   中英

What time format is this? I don't think it's unix timestamp

Hello I'm coding a script to fetch creation dates of specific profiles on a platform what time format is this?

1396752197709867

截屏

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM