1120
you are viewing a single comment's thread
view the rest of the comments
[-] fubarx@lemmy.ml 82 points 1 year ago

Worked on a project where devices just magically froze, but only during the month of February!

Turned out the people who had written the firmware had decided to do their own time math to save space and had put in an exception in the code for leap year values. Except instead of February 29th, it kicked in for the whole month. And the math was wrong so you ended up with negative values.

The product was due for launch in March of that year and was headed to manufacturing. It was by sheer luck that someone ran a test on February 1st and caught the problem.

Don't mess with time in code, kids.

[-] uis@lemm.ee 2 points 1 year ago
[-] fubarx@lemmy.ml 8 points 1 year ago

Consumer health.

Good product, too. Won a bunch of awards. Unfortunately, the company has since gone out of business.

[-] LodeMike@lemmy.today 0 points 1 year ago

This is why we have pre-built libraries and Unix time.

[-] fubarx@lemmy.ml 0 points 1 year ago

Embedded portable device with a teeny ARM processor. Sadly, no room for linux anything or even an RTC. Every time it connected to a phone, the phone would set its clock so the timestamps were somewhat close to being accurate.

However, if you swapped out the AAA battery and DIDN'T connect it to the phone at least once, all your subsequent readings would go back to zero epoch and would be forgotten 🤷🏻‍♂️

Good times.

this post was submitted on 03 Apr 2024
1120 points (100.0% liked)

Programmer Humor

25495 readers
2129 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS