Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Finance needed to do end-of-year stuff a couple of days past end-of-year. The system couldn't handle this, bad things would happen and data would change once end-of-year passes.

Solution? A bash script that does:

   while true:
       set date to 4pm end-of-year
       sleep 1




Why the loop, vs setting the date once?


NTP would resync it, and obviously after X hours it would no longer be end of year even if you set the date in the past.

It needed to be end of year day for 2 or 3 days.


yeah I get that but `while(true)` seems excessive. Why not just do it once and disable NTP?


because time moves forwards, and if you set it to 4pm then in 1.5 hours it will be 5.30pm, and the end-of-year stuff will kick in?

Three lines of bash seemed simpler. It's a hack, yes, and there are better ways. But really who gives a damn.


I would guess the system was probably running ntpd or some other time sync service that they were unwilling or unable to turn off.




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: