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

For quick scripts, I do all my date math with seconds-since-the-epoch, retrieved with "date", and then convert back at the end. The final date benefits from the latest timezone package update, so mostly I do OK.



This mostly work without problem for past time, but it can be wrong for future time, since timezone/DST may change. When you want 2pm next Sunday, you want 2pm next Sunday local time, not whatever 2pm next Sunday is supposed to be as of now.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: