Search code examples
pythonmysqljsontimestampunix-timestamp

What kind of date format is this: 1609078919000?


I have thee following datetime value saved within a json file:

"date": 1607230711000,

This represents:

27.12.2020

It does not seem to be a unix timestamp. What kind of format is this?

Would like to convert it in python to be able to save to MySQL DATETIME field.


Solution

  • That's a 13 digit epoch time. The last 3 digits being zero you can remove them and treat it as a 10 digit one. The 13 digit form is milliseconds rather than seconds. You can divide it by 1000 to get seconds. This is similar to this question here:

    How to convert a 13 digit Unix Timestamp to Date and time?