Which Format is it ? Countdown.js

Viewed 48

i got here in an .php file code this js code for an Countdown. Does anybody know which Date Format is it ? I dont get it..

                startDate   : "1932248800",
                endDate     : "2132248800",
        now     : Math.round(+new Date()/1000)
            });

Thanks.

2 Answers

Looks like unix timestamp in seconds:

const dates = {
  startDate: "1932248800",
  endDate: "2132248800",
  now: Math.round(+new Date()/1000)
}
console.log(Object.keys(dates).map(key => 
  `${key}: ${dates[key]} = ${new Date(dates[key] * 1000)}`
).join('\n'))

Seems a time offset since if it was a unix epoch, then the dates are far in the future

const dates = {
  startDate: "1932248800",
  endDate: "2132248800",
}
console.log(Object.entries(dates).map(([key,val]) => 
  `${key}:  ${new Date(+val+new Date().getTime())}`
).join('\n'))

Related