0

I looked at various examples on the net; however, i cannot seem to the get the LinkedIn timestamp to parse correctly.

Inpeticualy the year.

What am i missing here?

1352236307000

      function parseTwitterDate(epoch) {
                    var newDate = new Date();
                    newDate.setTime(epoch * 1000);
                    dateString = newDate.toUTCString();
                    return dateString;
                };

Posted Sun, 30 Aug 44820 04:23:20 GMT

  • People landing on this question might also be interested in converting a LinkedIn post URL to a human-readable timestamp https://stackoverflow.com/a/72415986/470749 – Ryan Jan 31 '23 at 15:10

2 Answers2

1

Simple pass this in as a param to the date constructor:

new Date(1352236307000).toLocaleString()
JAR.JAR.beans
  • 9,668
  • 4
  • 45
  • 57
1

It's in milliseconds. Just divide with 1000.