4 ms·
Not sure if this is a gotcha, but how does one make a JS date object (across Safari, FF and Chrome) that refers to the same day of the year regardless of timezo
by fareesh 4y ago
Not sure if this is a gotcha, but how does one make a JS date object (across Safari, FF and Chrome) that refers to the same day of the year regardless of timezone?
- chaitanya 4y agoYou can’t, because JavaScript date objects are just timestamps. Here’s what I wrote on this (along with a small library to handle this problem): https://lisper.in/javascript-date https://lisper.in/javascript-date
- fareesh 4y agoInteresting, thank you for your work, I might use it in a project. Edit: looks like I need a date object specifically, so I will go with the timezone conversion method and convert back to timestamp