1

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.

merlin
  • 2,717
  • 3
  • 29
  • 59
  • Are you sure that it is 2020-12-27? Because assuming it's epoch milliseconds, it would be 2020-12-06T04:58:31Z – Mark Rotteveel Mar 27 '21 at 15:54
  • According to https://www.timecalculator.net/milliseconds-to-date it's Dec 5 2020, 23:58:31. – The Impaler Mar 27 '21 at 16:57
  • related: [Converting unix timestamp string to readable date](https://stackoverflow.com/questions/3682748/converting-unix-timestamp-string-to-readable-date) – FObersteiner Mar 27 '21 at 17:28

1 Answers1

0

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?

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38