A while back I was developing a workflow scheduler. However the run duration kept coming back negative. The runs kept finishing like 15 seconds before they started. Eventually I figured out why; the company had configured a policy to use their custom NTP server, but it was 16.7 seconds off. So my Windows laptop’s time was in the future, but the WSL VM (which ran the program) used another NTP server and was correct. In the end I just added a bodge that made the program request the time from an external server on startup to calculate an offset.

  • Bassman1805
    link
    fedilink
    arrow-up
    3
    ·
    2 hours ago

    I had a system that would fail if you ran it on leap days.

    It was used to calibrate equipment, and would generate a calibration certificate after the procedure was completed. One field in the certificate was “calibration due date”, which the program calculated by taking the current date and adding 1 to the year.

    Whoever wrote the program had enough foresight to use a datetime library that recognized “Feb 29, 2021” was not a valid date, but not enough foresight to use that library’s date math functions to add 365 days.

    The official solution was “just hold off on calibrations until tomorrow and we’ll fix that in the 2.0 calibration machine we’re working on.” The 2.0 machine was already years behind schedule, and I’m not sure it ever got completed after I left that company. I bet the bug still existed on Feb 29, 2024.