spencermountain / spacetime

A lightweight javascript timezone library
http://spacetime.how/
Other
3.97k stars 184 forks source link

Specific date is not getting the correct epoch #389

Closed jecraig closed 11 months ago

jecraig commented 1 year ago

Version 7.4.3

I would expect the following

spacetime('03/31/2002', 'America/Denver').epoch === 1017558000000

but what I actually get is 1017554400000

It appears to be an issue with the continental US timezones.

spencermountain commented 1 year ago

hey Jacob, this seems correct to me

let s = spacetime('03/31/2002', 'America/Denver')
console.log(s.iso())
//2002-03-31T00:00:00.000-06:00

d=new Date('2002-03-31T00:00:00.000-06:00')
d.getTime()
1017554400000

cheers