What kind of date is this data formatted to and how do I read it / handle it in Javascript/React? [duplicate]

  date, javascript, sorting, time

This is the payload (I’ve obfuscated sensitive details):

{"newsletters": [{"id": 3, "title": "xxxxx Newsletter #3: xxx Takes Dogs to the Pound", "datetime": 1621083114000.0, "image": ""}, {"id": 2, "title": "xxxxs Newsletter #2: xxi Flops, xxxx Pops", "datetime": 1620391787000.0, "image": ""}, {"id": 1, "title": "xxxx Newsletter #1: Food xx vs Fx", "datetime": 1619898207000.0, "image": ""}]}

I am most curious about the datetime property. I have never seen time formatted like this. I am going to simply render the list in descending order, and would like to be confident that I understand the format of this time. Thanks!

// editor: As you can see it is completely parsable
console.log(new Date(1619898207000.0))

Source: Ask Javascript Questions

LEAVE A COMMENT