Lurker News
After a frantic scramble this morning, our billing team has finished patching a bug which erroneously was charging our monthly subscribers for an extra day.

All test suites are passing now, and SRE has scheduled a postmortem after the QA confirms the fix in 2028.

Comments (481) 159 threads

Earlier comments
habibur1 reply#
I wear Xiaomi's Amazfit Pro 3R. Digital. Wrist band. Hung at midnight of 29th Feb today. Did a bunch of factory reset but didn't recover. And then recovered at the morning of 1st of March.

Date is relatively simple.

    days_in_month(year, month) :
      if(month==2) return days_in_feb(year)
      //all other months have constant number of days, always.

    days_in_feb(year,month) :
      if(!(year % 400)) return 29;
      if(!(year % 100)) return 28;
      if(!(year % 4)) return 29;
      return 28;
And you are done for all Gregorian years.
rep_lodsb1 reply#
your function returns 29 days for every year not divisible by 400
wruza1 reply#
!(x % y) is the same as (x % y == 0), which means the remainder is zero, so x is divisible by y.

So it returns 29 if divisible by 400, 28 if divisible by 100, etc.

rep_lodsb#
Oops, you are absolutely correct!
evanb2 replies#
Payroll software at work had a one-off planned maintenance day today, presumably to avoid worrying about any bugs.
dasil003#
lucky it didn't fall on a payday eh?
zie#
Today is a payday for us, worked great!
0x54MUR411 reply#
I did.

Unit tests were broken in the CI pipeline because of a leap year. The problem was validating the number of days in a year, but dismissing a leap year. The code assumed the number of days in a year was 365.

prh8#
Same thing for us
hiAndrewQuinn#
Yeah! Our friends got married yesterday, and now they have until 2028.02.29 to legally change their names.

Load more comments