Hacker News new | past | comments | ask | show | jobs | submit login

Very relatedly, there's a potential similar footgun related to hours, due to the fact that dates initialized without hour default to 00:00, and that JS dates are in user's current local timezone.

It's possible then that after changing the month programmatically, the time component will jump to 23:00 due to timezone DST changes, and the date will jump back one day as well due to this (and in an unlucky case, the month will jump back as well!)

Example bug I had in 2014 when Russian timezone definitions have changed:

https://github.com/yui/yui2/pull/15

A workaround is to initialize dates with fake "midday" time component so that you avoid the day jumping back.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: