return to table of content

Ask HN: Did you encounter any leap year bugs today?

jewel
54 replies
19h40m

We have a product that uses ChatGPT via the API, using the 3.5 turbo version. Our query involves some dates. Instead of giving back text like it usually does, today it has been giving errors because it does not think 2024-02-29 is a valid date.

This is easy to reproduce with the web interface, at least sometimes [0]. It start out by saying it's not a valid date and then as it's explaining why it isn't it realizes its mistake and sometimes corrects itself.

[0] https://chat.openai.com/share/37490c9f-81d6-499f-b491-116536...

littlestymaar
32 replies
18h46m

Wired: LLM are practically AGI

Tired: ChatGPT thinks February 29th isn't a valid date.

pquki4
21 replies
17h34m

My favorite prompt: asking "How many e's are there in the word egregious". Always says three (ChatGPT 3.5, 4, 4 turbo). When you ask it which three, it realizes its mistake and apologizes (or sometimes tells you where they are that is completely wrong). Looks like it just outputs gibberish for these things.

moozilla
10 replies
16h16m

ChatGPT is specifically bad at these kinds of tasks because of tokenization. If you plug your query into https://platform.openai.com/tokenizer, you can see that"egregious" is a single token, so the LLM doesn't actually see any "e" characters -- to answer your question it would have had to learn a fact about how the word was spelled from it's training data, and I imagine texts explicitly talking about how words are spelled are not very common.

Good explanation here if this still doesn't make sense: https://twitter.com/npew/status/1525900849888866307, or check out Andrej Karpathy's latest video if you have 2 hours for a deep dive: https://www.youtube.com/watch?v=zduSFxRajkE

IMO questions about spelling or number sense are pretty tired as gotchas, because they are all basically just artifacts of this implementation detail. There are other language models available that don't have this issue. BTW this is also the reason DALL-E etc suck at generating text in images.

Izkata
8 replies
15h28m

If you plug your query into https://platform.openai.com/tokenizer, you can see that"egregious" is a single token

That says it's 3 tokens.

wruza
3 replies
14h37m

It doesn’t even matter how many tokens there is, because LLMs are completely ignorant about how their input is structured. They don’t see letters or syllables cause they have no “eyes”. The closest analogy with a human is that vocal-ish concepts just emerge in their mind without any visual representation. They can only “recall” how many “e”s are there, but cannot look and count.

alickz
1 replies
7h15m

They can only “recall” how many “e”s are there, but cannot look and count.

Like a blind person?

wruza
0 replies
5h59m

My initial analogy was already weak, so I guess there's no point in extending it. They key fact here is that tokens are inputs to what essentially is an overgrown matrix multiplication routine. Everything "AI" happens few levels of scientific abstractions higher, and is semantically disconnected from the "moving parts".

brewtide
0 replies
14h2m

Pre-cogs, I knew it.

ToValueFunfetti
2 replies
13h3m

The number of tokens depends on context; if you just entered 'egregious' it will have broken it into three tokens, but with the whole query it's one.

fuzztester
1 replies
10h58m

Why three tokens, not one?

317070
0 replies
10h20m

without the leading space, it is not common enough as a word to have become a token in its own right. Like the vast majority of lowercase words, in OpenAIs tokenizer you need to start " egregious" with a space character for the single token.

redox99
0 replies
11h10m

" egregious" (with a leading space) is the single token. Most lower case word tokens start with a space.

chgs
0 replies
8h57m

Chatgpt could say “I don’t know”

devjab
8 replies
17h14m

It’s always gibberish, it’s just really good at guessing.

I forgot what exactly it was I was doing. We were trying to get it to generate word lists of words ending with x or maybe it was starting with. For a marketing PoC and it made up oceans of words that not only didn’t start/end with x but mostly didn’t include x at all.

Isn’t this also why it can pass CS exams and job interviews better than like 95% of us, but then can’t help you solve the most simple business process in the world. Because nobody has asked that question two billion times on its training data.

mewpmewp2
7 replies
16h59m

But also it doesn't see characters. It sees tokens. The only way it would be reliably able to solve it is if it had a lookup table of token to characters. Which it likely doesn't.

You couldn't do it either unless you learned the exact matchings of all tokens to all characters in that token and their positions if you were given tokens as an input. You would have learned the meaning of the token, but not what the exact characters it represents.

yousif_123123
6 replies
16h15m

Even if it sees tokens, I don't think it's an impossible task. Certainly an advanced enough LLM should be able to decipher token meanings, to know that a word is made up of the individual character tokens regardless of how the full word is tokenized. Maybe something gpt5 can do (or there's some real technical limitation which I don't understand)

Izkata
5 replies
15h26m

to know that a word is made up of the individual character tokens

A token is the smallest unit, it's not made of further tokens. It maps to a number.

pests
2 replies
13h30m

He's saying the LLM will figure out how many letters are in each token.

wruza
0 replies
12h0m

It's as feasible as telling how many chars in html lead to this comment by looking at a screenshot. LLM doesn't see characters, tokens, numbers or its own activations. LLM is a "set of rules" component in a chinese room scenario. Anything an operator of that room does is lower-level.

GGP's idea suggests that an LLM, allegedly as a whole-room, receives something like: "hey, look at these tokens: <tokens>, please infer the continuation". This puts it into a nested-room's-operator position, which (1) it is not, (2) there's no nested room.

littlestymaar
0 replies
11h58m

They cannot “figure” it, they could learn it but for that it would need to be in it's training data (which isn't because nobody is writing down the actual pairing in every byte pair encoding in plain text. Also the LLM has no clue about what encoding it uses unless you tell it somehow in the fine-tuning process or the prompt.)

nvader
1 replies
13h24m

I think what of is getting at is that given

{the:1, t: 2, h:3, e:4}

There should be somewhere in the corpus, "the is spelled t h e" that this system can use to pull this out. We can ask gpt to spell out individual words in NATO phonetic and see how it does.

littlestymaar
0 replies
10h7m

There should be somewhere in the corpus, "the is spelled t h e" that this system can use to pull this out.

Such an approach would require an enormous table, containing all written words, including first and last names, and would still fail for made up words.

A more tractable approach would be to give it the map between the individual tokens and their letter component, but then you have the problem that this matching depends on the specific encoding used by the model (it varies between models). You could give it to the model during fine-tuning though.

botanical
0 replies
9h49m

I just asked it with Gemini; at first, it got it right. Then I asked if it was sure and it apologised and said 3 is the correct answer. When asked what are the 3 "e"s, it says:

The three "e"s in "egregious" are: > > 1. The first "e" is located in the first syllable, between the "g" and the "g". > 2. The second "e" is located in the second syllable, following the "r". > 3. The third "e" is located in the third syllable, following the "i" and before the last "o".
pants2
7 replies
18h11m

For the record, both ChatGPT-4 and Gemini Ultra affirmed that it's a valid date. Gemini reasoned through it and GPT-4 ran python code to make sure 2024 was divisible by 4.

roland35
5 replies
17h34m

Interesting... But that isn't exactly true! Centuries that are not divisible by 4 don't count!

swores
4 replies
16h56m

I've yet to come across a form of 100 that isn't divisible by 4... since 25 usually still exists!

But I do remember there being some weird niche rules about which years are or aren't leap years, so I'm guessing your comment is basically right just wrongly worded?

latexr
2 replies
16h42m

The rule is that leap years are the ones divisible by 4. Unless it’s also divisible by 100. Unless unless it’s divisible by 400.

So 2000 was leap, but 2100, 2200, and 2300 won’t be, but 2400 will be.

swores
1 replies
16h39m

Ahh, so it's centuries that aren't divisible by 400 rather than that aren't divisible by 4, that makes more sense!

Thanks for answering

thaumasiotes
0 replies
15h23m

It's centuries that aren't divisible by 4. It isn't years that aren't divisible by 4.

inglor_cz
0 replies
9h17m

The GP formulated it in a somewhat unclear way. "Centuries" divisible by 4 probably meant "years" divisible by 400.

So, 19th century (1900 is the last year) isn't divisible by 4 (19/4 is not integer), which is the same as saying that 1900 isn't divisible by 400.

This is the main reform of the Gregorian calendar - leap days aren't introduced on xy00 years which aren't divisible by 400. This corrects the length of a year to 365.2425 days, which is fairly close to the real value of 364.2422 days.

The original Julian calendar had year of 365.25 days, which aggregated an error of more than ten days over the centuries.

daseiner1
0 replies
17h41m

Did it also check if 2024 is divisible by 100 but not 400?

peteradio
0 replies
18h8m

But akshually neither does my uncle Ned

AlienRobot
0 replies
18h28m

That's because it's trained on 2021 data. No February 29 back then!

baron816
11 replies
17h20m

ChatGPT thinks today is March 1. Go ahead and ask it what today’s date is.

huytersd
5 replies
16h53m

No, 2024 is not a leap year. Leap years are years divisible by 4, except for years that are divisible by 100 unless they are also divisible by 400. Therefore, the next leap year will be 2024.
rodface
3 replies
16h28m

As the proud new owner of a leap day baby, I find this to be extra hilarious

pizzafeelsright
0 replies
14h51m

I was at the hospital and heard two babies being born. I love that music.

hilux
0 replies
9h42m

Congratulations!

Big savings on parties and cake!

heywoods
0 replies
15h39m

Congratulations!

muzani
0 replies
5h42m

Apparently it reads 2024 as two different numbers: 202 and 4

vdfs
0 replies
17h18m

It is March 1 in many places

s9df898r32h
0 replies
16h6m

thats better then Mistral... it "thinks" it is March 15th 2023

"The current date is March 15, 2023. However, please note that as a large language model, my knowledge is based on the data I was trained on, which is up to 2021. Therefore, I cannot provide real-time information or updates on current events or dates. I recommend checking a reliable source such as a calendar or a trusted news website for the most accurate and up-to-date information."

js2
0 replies
15h30m

As of 10 PM US/Eastern, ChatGPT 3.5 answers as follows for me:

You: what is today's date?

ChatGPT: Today's date is February 29, 2024. Please note that February 29 occurs only in leap years. If you have any more questions or if there's anything else I can help you with, feel free to ask!
floydianspiral
0 replies
15h36m

openai actually in their platform for billing, etc shows that its actually march 1 as well.

cheapgeek
0 replies
15h25m

It's UTC. Ask it what day was yesterday.

esalman
6 replies
11h51m

Blows my mind that people consider using ChatGPT for serious applications. I mean it's fine as a code autocorrect/autocomplete tool as in GitHub copilot. But it should not replace the code itself. You encounter a bug in the code, you fix it, you never encounter it again. But ChatGPT will repeat the same mistake sooner or later. That's not how we should engineer solution for critical problems.

lucumo
2 replies
11h30m

If the cost-savings is worth it compared to the problems...

I mean, that's how we do it with humans. It's quite a common occurrence to keep a part of a business process human because automating it would we too expense due to edge cases.

Humans make mistakes and are expensive, but are also flexible and usually smartish. ChatGPT makes mistakes and is usually dumbish, but is also flexible and cheap.

Engineering is about picking the right trade-offs in your solution.

fuzztester
0 replies
11h1m

I mean, that's how we do it with humans. It's quite a common occurrence to keep a part of a business process human because automating it would we too expense due to edge cases.

Which part of the human do people keep? The head? Arms? ;)

#ParsingAmbiguityError

fractalb
0 replies
11h22m

ChatGPT makes mistakes and is usually dumbish, but is also flexible and cheap.

People wouldn't mind it if the keyword `dumbish` has been all along there.

makoto12
0 replies
9h44m

If you sandbox your connection to openAI correctly, then you can get the benefit of a llm without making your application look silly at the same time. Identifying the correct places in your business to use it is tricky, but imo it certainly makes sense in a lot of specific areas. Just not a catch all that can run your business for you

ativzzz
0 replies
3h4m

It's great for prototyping and creating outlines/rough drafts or for creating rough summaries - you can build this into some features to help your customers speed up writing lots of text

Draiken
0 replies
7h41m

As long as you add the "AI" keyword to the product/app/company and sell to people that don't understand how unreliable it is, you're good.

Let me rephrase that: you can profit from it. Even if it's not good.

lynx23
1 replies
11h28m

Saw the same via the API with gpt-4-0125-preview. IOW, even gpt-4 thinks 2024 is not a leap year.

kccqzy
42 replies
21h33m

Heard from a friend in China: the age calculation portion of the app to schedule a marriage certificate had a bug where they subtracted 22 (legal minimum age) from the year, which resulted in 2002-02-29 which doesn't exist. The app intends to compare this against the user's birth date. The error handling code assumes all errors are from the comparison. The app then rejected all marriage certificate appointments by complaining that the users are too young to marry legally.

xattt
33 replies
18h38m

How do leap day birthdays get handled in general? How is the right age iterated every year?

paulddraper
25 replies
16h24m

Both Feb 28 and Mar 1 are commonly used to celebrate birthdays.

AFAIK there is no firm convention. Feb is more natural ("My birthday is in February"), Mar is more logical (the 60th days of the year).

js2
24 replies
15h34m

Is March more logical? Feb 29 + 1 year = Feb 28.

edflsafoiewq
7 replies
13h20m

By this logic, all birthdays would slowly drift as leap years pass.

drdeca
6 replies
12h22m

Take DOB + n * 365.25 and then pick whatever day that falls in? That way it shouldn’t drift overall. Though, I guess it would imply that what day of the year people celebrate on, would be off by one day on leap years compared to what it is on other years?

iforgotpassword
5 replies
11h29m

This formula doesn't consider how we sometimes skip leap years, and sometimes have leap seconds, so it's vastly imprecise.

munch117
4 replies
11h6m

So make it more precise. DOB + n * 365.2421.

histories
3 replies
9h41m

365.2425

histories
1 replies
6h31m

Omitting a leap year every 4000 years

Wait, is this right? omitting every 100 and adding every 400 should be enough.

EDIT: the 4000-year rule is just a proposal for now. So 365.2425 is correct.

mark-r
0 replies
5h3m

None of us will live long enough to see the 4000-year rule become a problem. I don't even expect to be around for the next 100-year rule.

paulddraper
4 replies
11h47m

You're begging the question. [1]

"Feb 29 + 1 year" is verbatim restatement.

---

You can say Feb 29 + 365 days = Feb 28. (And Feb 29 + 730 days = Feb 27.)

---

EDIT:

Note that in the context of birthdays, people use "calendar years," not "unit of time which is ~1 revolution around the sun."

Birthdays aren't celebrated every X million seconds after the moment of birth.

They are celebrated the same day each calendar year -- notwithstanding the fuzzy concept of "same day" for incongruent calendar years. There's no singuar right answer, but that is the core question: "what is the same day next (calendar) year?"

[1] https://en.wikipedia.org/wiki/Begging_the_question

quietbritishjim
1 replies
9h43m

Feb 29 + 365 days = Feb 28.

Correct.

And Feb 29 + 730 days = Feb 27

Incorrect. It's Feb 28 again. In a normal, non-leap year, if you add 365 days then you get back to the same date.

paulddraper
0 replies
2h25m

Sorry, typo I meant that Feb 28 + 730 days = Feb 27 (sometimes)

mark-r
0 replies
5h6m

Birthdays aren't celebrated every X million seconds after the moment of birth.

As a surprise for a friend of mine, I threw him a gigasecond party on the day he turned 1000 million seconds old. Yes he was surprised, and a good time was had by all.

azalazar
0 replies
1h0m

Many people say: Happy turn around the sun! and 365 is not the length of a year is the length of some years so, who knows... I'm against time zones and pro 28 days months and a couple of free days :D

jey
4 replies
15h19m

What’s the significance of 365? Each Earth year has just a smidge under 365.25 days.

js2
2 replies
14h59m

365 days is what people commonly think of as a year. So if you're born Feb 29th and celebrate your birthday one year later (whether you call that 365 or 365.25), you land on Feb 28th. Then again, folks born between Jan 1 and Feb 28th of a leap year celebrate their birthdays 366 days later by calendar days.

Anyway, I'm not sure there's any more or less logical date to use and Feb 29th babies seem to choose both about equally:

“I love when people ask me, ‘Do you celebrate on Feb. 28 or March 1?’” said Raenell Dawn, a co-founder of Honor Society of Leap Year Day Babies. “I get to tell them, ‘Both, because I can.’ But I’m a February baby; I was not born in March.” An informal poll of the society’s members showed about a 50-50 split between the two dates, said Ms. Dawn, who is celebrating her “Sweeter 16” by turning 64 this year.

https://www.nytimes.com/2024/02/28/style/leap-year-explained...

dexterdog
1 replies
14h7m

Celebrating on the 28th makes no sense. That is when you celebrate your Birthday Eve every year so your birthday is the next day, whatever that is.

smrq
0 replies
13h26m

You can make the same argument that March 1st makes no sense, as that is the day of your birthday hangover, the day after whenever your birthday is.

carleverett
0 replies
13h26m

But 1 day is still 24 hours.

If you want to celebrate your birthday at the moment earth reaches the same spot around the sun as when you were born, then we’d all have the same issue - we’d have to celebrate it 6 hours later every year, reseting every 4 years.

February 29 is very much a new day… which simply doesn’t exist on non-leap years.

silisili
1 replies
14h1m

Think of it this way: if Feb 29 didn't exist that year, it would have been March 1.

If we're being scientific I guess all of us should move our birthday up by 1 day on leap years, but that seems annoying and not sure anyone really cares enough to.

prmoustache
0 replies
8h12m

No we should move our birthday celebration up by 6 hours every year. But that would be only relevant if we were celebrating at the exact hour of our birth.

Scarblac
1 replies
11h4m

Feb 28 is definitely too early, you haven't lived a whole year yet since your birthday. So March 1 it is. It's not your birthday but you can celebrate having made it another year.

Jeema101
0 replies
3h55m

Well 'year' can mean two different things though: 'calendar year' or 'solar year'.

Your calendar year birthday would be March 1 since one full calendar year has elapsed.

But Feb 28 is the nearest day to one full solar year, assuming you were born before about 6pm local time on Feb 29.

Two-day long birthday it is! :)

runarberg
0 replies
12h12m

I asked JavaScript:

    const { format } = Intl.DateTimeFormat("en-UK", { month: "short", day: "numeric" });

    const date = new Date(2024, 1, 29);
    console.log(format(date));
    // 29 Feb

    date.setYear(2025);
    console.log(format(date));
    // 1 Mar

    const year = 1000 * 60 * 60 * 24 * 365.2425;
    console.log(format(new Date(2024, 1, 29).getTime() + year));
    // 28 Feb
I guess both are logical by some definition of logic.

DinaCoder99
4 replies
16h29m

Sadly, I can say from experience the American draft does not count the number of birthdays celebrated to figure out if you're eligible to serve.

qup
3 replies
15h36m

You got drafted when you were five?

guappa
2 replies
9h36m

More like 4… since you can go to vietnam at 17. You're thinking of the age to drink a beer.

qup
1 replies
9h12m

Can't get drafted at 17. I don't know if you can go or not.

usr1106
0 replies
11h22m

Relevant question for driving, voting, marrying, drinking. I'd assume just the date is compared.

If you are born on 29th, on future 28th you are considered "too young", regardless whether a 29th exists or not. On future March 1st you are "old enough" again regardless.

If a 29th exists you are old enough already on that date. Drinking beer in Germany at 16, I guess in some countries at 20 could be relevant cases. For the more common minimum age of 18 for many things, the limit is reached always on March, 1st because a 29th cannot exist.

ao98
0 replies
18h29m

The most common approach I’ve seen is to alias them to Mar 1st.

chaorace
3 replies
20h48m

Haha, that would be quite the appropriate place to put one of those "Please wait and try again" error messages.

tedajax
2 replies
18h56m

"look, today the math just doesn't work out, try tomorrow"

Saigonautica
1 replies
15h9m

This is often the result of consulting an astrologer in Asia for a marriage date, to be fair.

Rastonbury
0 replies
2h48m

Maybe some people trying to get away with buying anniversary gifts every 4 years

swasheck
2 replies
18h11m

so … many bullets were dodged today

peteradio
0 replies
18h9m

It's a leap year miracle!

DANmode
0 replies
17h54m

Opinionated devs are the best devs.

Tell us about your last marriage?, lol

alphanumeric0
0 replies
16h16m

This is why you use a datetime library.

rlaager
25 replies
21h52m

One cleanup script broke because Python doesn’t have a clean way to subtract a year, and if you do now.replace(year=now.year-1), you get a ValueError when now is 2/29.

It’s easy enough to address. There are various StackOverflow posts on such things. Here is one: https://stackoverflow.com/questions/54394327/using-datetime-...

aiiane
12 replies
21h38m

What is your definition of "subtracting a year"? Seems like that's a relatively ambiguous operation without more specification.

Ensorceled
5 replies
21h30m

Can you think of any situation where subtracting a year from today's date is ambiguous when today isn't, well, today?

OJFord
2 replies
19h48m

Moving bank/festive holidays, first Monday of the year(, first work day of the year not Monday if that's NYD and bank holiday), lunar occasions.

'subtract a year' is imprecise and has many meanings, if what you want is 'same day, same month, previous year' then say that and do that, that's conceptually `date.year -= 1` not `date -= 1 year`, and will have this bug.

chatmasta
1 replies
19h12m

You could subtract 365.25 days, but then you're left with a new problem: just because you can amortize a leap day over four years doesn't mean that you get an extra 6 hours each year.

OJFord
0 replies
18h37m

And as I just learnt elsewhere in this thread, it would actually be three four-hundredths less than that anyway, i.e. 365.2425, since only one in four centenaries is a leap year.

aiiane
0 replies
21h0m

Yes - on any day, subtracting a year might mean subtracting the average length of a year (which is a bit more than 365 days), or wanting the same day and month number in the previous calendar year, or wanting the same semantic difference ("last Monday of the month in January"), to name a few possible meanings.

kccqzy
3 replies
21h30m

Since they mentioned a clean up script, I assume they could easily just use 365 days for that use case.

hinkley
2 replies
21h23m

But then it'll be off by one day for the rest of this year. And someone will notice that they no longer have March 1 2023-March 1 2024 in their chart, but March 2 2023

kccqzy
1 replies
19h36m

It's a cleanup script. I bet nobody cares it's off by one day. Also I doubt a cleanup script has a charting function.

Everything is use case dependent. Sometimes the use case is unimportant enough that mistakes are okay.

hinkley
0 replies
19h14m

While that's true, I'm sharing scar tissue here not hypotheticals.

There's often someone out there who interprets such things as a 3 month, or 1 year retention policy and that it means they're entitled to look at the entire range whenever they want.

ddgflorida
0 replies
18h35m

Plenty of thought has gone into this. Look at what database date functions do when you ask it to subtract 1 year. I will agree that there is not one answer.

adrianmonk
0 replies
18h45m

It is ambiguous, but one part that's pretty unambiguous is that the result should be a date, not a crash.

natrius
5 replies
21h29m

It's not that python doesn't have a clean way to subtract a year, it's that "subtract a year" is imprecise. There's a clean way to subtract 365 days, and there's a clean way to set the year one year earlier. But if you're doing the second thing, is python supposed to silently change to March 1 when you change the year from a leap day? There's no way around handling edge cases.

samatman
2 replies
18h45m

This has been a factor in contract law for longer than computers have existed. "Subtract a year" or "Add a year" aren't really imprecise, it's just that there are two ways you can interpret it: 365 days, or 12 months. When adding, you get the same result: end of February, the 28th. Subtracting, you get one of March 1st for 365 days and February 28th for 12 months.

Most jurisdictions use the 12 month standard, fwiw. I believe that's the ISO ruling as well, but I wasn't able to confirm that.

emmelaich
1 replies
17h48m

Which type of year? Sidereal or solar? Did you account for axial precession?

samatman
0 replies
4h13m

To be a bit blunt, these questions are entirely irrelevant, since you know the answer as well as I do: the calendar year, the one Western law and international business uses uniformly. It's very clever of you to mention that other concepts of the year exist. Kind of. Would have been more clever if you'd realized that they aren't germane, any more than the Islamic, Jewish, Indian, or Chinese years are.

bhaney
0 replies
17h30m

There's a clean way to subtract 365 days

What is it? Does it attempt to return a datetime that's the same time as the input but 365 calendar days earlier (ignoring leap seconds? compensating for time zone changes?), or does it subtract 31536000 seconds from the current datetime? Because those aren't necessarily the same and it's ambiguous which one you mean by "subtract 365 days"

Swenrekcah
0 replies
21h20m

APy should just figure out what I would have wanted to happen

LeoPanthera
2 replies
21h14m

now.replace(year=now.year-1)

Yeah but this is bad code. Python certainly does have a "clean" way to subtract a year, you subtract a datetime.timedelta object.

yen223
1 replies
18h5m

timedelta doesn't take "years" as a parameter, for the reasons others have listed here. It's ambiguous what subtracting by a year means, and there's no real sensible default either.

LeoPanthera
0 replies
16h38m

relativedelta will do it:

  from dateutil.relativedelta import relativedelta
  one_year = relativedelta(years=1)

iooi
0 replies
21h11m

which is why you should use arrow

VirusModulePtr
0 replies
21h28m

Okay I am having really odd undefined behavior in Python in UART communications that were working just fine yesterday... My boss joked it could be a leap year thing but at this point it wouldn't surprise me. Switch over to using Rust and no issues at all

yanateras
21 replies
20h55m

The other way around! Today a few services that don't congratulate me on my birthday (on non-leap years) did. I was born on February 29th.

Wowfunhappy
6 replies
18h57m

...it occurs to me, when should those services congratulate you? Should it be on February 28 or March 1?

wolfendin
2 replies
18h31m

365 days ago was March 1, 2023

mr_toad
0 replies
16h3m

This year has 366 days, or at least it does after Feb 29.

jerbear4328
0 replies
16h42m

In 365 days, it will be February 28, 2025

Which is more important, the past or the future?

yanateras
0 replies
18h13m

I’d say March 1! February 28 might be too early.

mnw21cam
0 replies
6h4m

At midnight in-between 28th February and 1st March.

jedberg
0 replies
18h51m

According to the government, Mar 1. Anything that is based on your birthday (driver's license, drinking, signing contracts, etc) all happen on March 1 if there is no Feb 29 that year.

Which makes sense since then it is "after" your birthday.

chatmasta
5 replies
19h15m

How often do you encounter challenges related to your birthday? Meaning, not just on the day of Feb 29, but any day of the year when you're trying to select your birth date or something like that. Do you ever find forms where the date is missing or the backend wont accept it?

yanateras
4 replies
19h7m

Occasionally, but less often than one could imagine! About a dozen times in my life.

Whenever February 29 wasn’t present as an option, the frontend was at fault, so I could set the right <input> value in the inspector as a workaround.

Other times February 29 was present as an option, only to be saved as February 28. Never March 1, which I’d say would be more coherent.

whycome
1 replies
16h6m

more coherent

depends on what you're trying to organize by. maybe 'birth month' is an important signifier.

yanateras
0 replies
15h52m

Here’s why:

* I was N years old on February 28th this year

* I will be N+1 years old on March 1st this year

Therefore:

* I was N-1 years old on February 28th last year

* I was N years old on March 1st last year

Perhaps the month is February and the non-leap year date is March 1st...

nyczomg
1 replies
15h51m

If it makes you feel better.... On February 29, 2008 I was working on a system as a government contractor. Part of it was outsourced to a sub-contractor who decided to write their own date/time library because how hard could that be (which I only learned about later)? For some reason NOTHING would work right that day. Took me longer than I'd care to admit of staring at the logs to realize that some started with March 1 2008....

edit: also happy birthday!

yanateras
0 replies
15h26m

Definitely not any more coherent on a leap year! That remark only applied to dates stored without a year, as in “February 29” rather than “February 29, 2008”.

Thank you..!

swader999
1 replies
19h2m

Happy birthday!

yanateras
0 replies
18h48m

Thank you ^_~

codetiger
1 replies
16h7m

Happy birthday to you! It’s a special day and We don’t get this chance to say this often. Enjoy your day

yanateras
0 replies
15h50m

Thank you :3

bombcar
1 replies
19h51m

Were you born on the day after Feb 28 or the day before Mar 1? ;)

jagged-chisel
0 replies
15h49m

Yes

seabass-labrax
0 replies
18h6m

Stay, yanateres, stay! They have no legal claim! No shadow of a shame will fall upon thy name: stay, yanateres, stay!

nortlov
12 replies
21h42m

The Casio F-91W doesn’t account for the year, it showed today’s date as Thursday, March 1st.

bakoo
6 replies
21h32m

Same with my colleagues most recent top model Samsung Galaxy Watch :]

dotnet00
2 replies
21h17m

Odd, mine is showing the right date.

davchana
1 replies
20h1m

Are you sure? My F91W doesn't even ask for year in settings. How would have it known it is a leap year or not.

Some other models (not F91W) does track year.

dotnet00
0 replies
19h50m

I was responding to the claim about the Samsung Watch not showing the right date, I unfortunately have never owned the older kinds of "smartwatches" :)

frankgrimesjr
1 replies
19h46m

Are they using a third party watch face? My Galaxy Watch 4 has no issues.

kennethrc
0 replies
16h53m

I have a custom watch face on my GW4 and it's showing the 29th

linker3000
0 replies
21h16m

OK on my Watch4 Classic FWIW.

LeoPanthera
1 replies
21h15m

That's more of a design decision than a bug. It's intentional to make the product cheaper. The manual does mention it.

tjvc
0 replies
21h2m

I noticed this too and clicked this thread wondering if it would show up! Still an awesome watch.

spicybright
0 replies
21h24m

Thank you so much for the reminder, that would have screwed me up today :)

computerfriend
0 replies
13h30m

I just looked at my watch and indeed the date is wrong. Thanks!

bregma
11 replies
21h28m

Python.

    cls = <class 'datetime.datetime'>, data_string = 'Feb 29 04:55:03.687' format = '%b %d %H:%M:%S.%f'
    E       ValueError: day is out of range for month

ptx
6 replies
20h20m

As mentioned by sibling comments, it's because you're not specifying a year. If you change the day to the 28th you'll see that it defaults to the year 1900:

  >>> datetime.strptime('Feb 28 04:55:03.687', '%b %d %H:%M:%S.%f')
  datetime.datetime(1900, 2, 28, 4, 55, 3, 687000)

  >>> datetime.strptime('Feb 28 13:37:06.942', '%b %d %H:%M:%S.%f') 
  datetime.datetime(1900, 2, 28, 13, 37, 6, 942000)

OJFord
5 replies
19h43m

That makes it weird though, because 1900 was a leap year? I sort of get it, but it's a slightly odd and inconsistent decision.

Edit: no it's not, it's absolutely correct, leap years just aren't as simple as I thought!

OJFord
1 replies
18h45m

Crikey - more helpful to me is the page linked from there - https://learn.microsoft.com/sl-SI/office/troubleshoot/excel/...

However, there is still a small error that must be accounted for. To eliminate this error, the Gregorian calendar stipulates that a year that is evenly divisible by 100 (for example, 1900) is a leap year only if it is also evenly divisible by 400.

For this reason, the following years are not leap years:

1700, 1800, 1900, 2100, 2200, 2300, 2500, 2600

I had no idea!

ahazred8ta
0 replies
14h36m

"We establish that a bissextile [366th day] shall be inserted every four years (as with the present custom), except in centennial years. So the years 1700, 1800, and 1900 will not be leap years. Assuredly, the year 2000 will have an extra day in it." -- Greg XIII, 1582

pxx
1 replies
19h31m

1900 was not a leap year... It's 0 mod 4, yes, but it's 0 mod 100 and not 0 mod 400

OJFord
0 replies
18h33m

Yep, thanks, I just wasn't aware of the latter rule at all. Time to re-read Falsehoods perhaps!

nicholasjarnold
0 replies
21h17m

confirmed. and interesting/unexpected! this breaks:

datetime.strptime('Feb 29 13:37:06.942', '%b %d %H:%M:%S.%f')

edit: added code example. import datetime from datetime first obvi

herpderperator
0 replies
21h21m

Interesting... I suppose that is because there is no year? What year does it default to? Can you show your exact line of code?

derefr
0 replies
21h18m

That doesn’t seem incorrect; given that no year is specified, it seems like it’s evaluating the constraint in the context of an implicit default year. (1970? 0CE?)

The confusing part, to me, is that Python would consider the above string to be parsed into a date in the first place, given that it has no year.

LeoPanthera
0 replies
21h16m

That's because you didn't specify a year.

trebligdivad
8 replies
19h25m

Fascinating - why does a LiDAR involve the date?

worik
6 replies
19h21m

For the survalence records

Telling base where, and when, you were

nemomarx
5 replies
18h45m

Shouldn't that just be a unix timestamp or something? You'd think resolving that to a date time could be done in the UI instead of in the business logic

defrost
2 replies
15h59m

Unix time has discrepancies whenever leap seconds occur (several times in my career aquiring geophysical data).

If you're measuring | controlling objects in the physical world (cars, rockets, etc) then you should not use unix time - those glitches will happen and instantaneous computations will go kooky.

https://en.wikipedia.org/wiki/Unix_time#Leap_seconds

redox99
1 replies
10h50m

But so does resolving to a date. I don't see how resolving to a date which cares about leap days fixes any of that.

You should use a monotonic clock with an arbitrary starting point anyway, unless you need some kind of synchronization between devices, but you probably wouldn't use unixtime there anyway.

defrost
0 replies
10h34m

But so does resolving to a date. I don't see how resolving to a date which cares about leap days fixes any of that.

So why bring it up then?

You should use a monotonic clock with an arbitrary starting point anyway

Sure. We started doing that more than 50 years ago now when broad area geophysical surveying started off.

unless you need some kind of synchronization between devices,

Can't see the problem - there are ways of syncing base station records against aircraft | boat | vehicle records in post processing .. all the stations, fixed or mobile, use a monotonic epoch based record structure that hold channel data and any sync marks that are broadcast by whatever means - raw GPS time serves well enough for a grain of 1.5 seconds, other marks can be used as required.

trebligdivad
0 replies
54m

I think I'd have used time-since-power-on; your infotainment system could take an RTC offset to get that to human dates.

topaz0
0 replies
17h30m

"should"

bnqscrtm
0 replies
16h6m

LiDARs and other sensors typically need to be time-synchronized with the rest of the robotic system. I wouldn't be surprised if the bug is related to that.

Cyberdog
3 replies
12h4m

The street lights use some sort of timer that's tracking dates? Don't they typically just use light sensors to know when to turn on? It seems to me that'd be a simpler solution and also provide light during solar eclipses, thick storms, etc.

anonymfus
1 replies
7h15m

First, these systems generally predate invention of semiconductor light sensors.

Second, how much light you need is proportional to human activity, not only to darkness. At deep night artificial lighting should be minimal to save energy, minimise disturbance to nature and people's sleep, while during early morning when kids go to schools it should be maximal.

Third, you need a central control over street lights anyway because you need to implement blackouts during wartime.

jpc0
0 replies
3m

Third, you need a central control over street lights anyway because you need to implement blackouts during wartime.

You heard of switches? Hell in our country with mandated rolling blackouts to prevent failure of the national electrical grid some sucker gets paid to drive around town every 2-3hours and flip a switch. Unrelated one municipality is failing to follow the mandate because they cannot afford said suckers overtime pay...

I also strongly believe well lit streets at all times are important, its better to try to limit the lights' bleed than it is to have darkness. One human killed or otherwise injured (rape/assault) due to bad lighting should be enough to say this is a bad idea.

iforgotpassword
0 replies
11h8m

Why should we pick a simple solution like that? Is it the 90s or what? Only a complete clown would pick anything other than a network of zigbee relays controlled by an unmaintained node.js app written by an out-of-business contractor, pulling in sunrise/sunset data from an external API and syncing its local time via a homegrown NTP alternative.

I mean look at electric cars.

blahedo
0 replies
11h56m

Oh! The street lamps on my campus didn't come on tonight when it got dark—it didn't occur to me then but this could totally be why.

aussieguy1234
0 replies
16h56m

Finally, night time photography without the street light pollution.

alickz
0 replies
7h13m

The City Without Lights

WarOnPrivacy
0 replies
19h1m

Improved nighting is an awesome gift. I'm jealous.

dr_kiszonka
7 replies
18h18m

One thing I have learned from HN is that datetime issues are hard, prolific, programming language agnostic, and not to trust myself to get the logic right. (The same applies to floats.)

submain
3 replies
18h13m

just like you don't roll your own crypto, you don't roll your own date libraries.

epolanski
1 replies
17h48m

Takes me less to launch some coin fork than getting even a single date time api correctly.

zormino
0 replies
17h40m

The API is correct, you just called it at the wrong time

wut-wut
0 replies
16h44m

Facts!

wruza
0 replies
14h15m

Another thing programmers should know and fix is that most of it is self-inflicted. When there’s no easy way to add a day, people add 86400000 and stumble upon a leap second. When time is not needed, they use fixed hours and fail at timezones. And so on. Most date libraries provide mostly trivial and at the same time low-level use-cases, so people do all the stupid math with what essentially is an irregularly-based number.

alickz
0 replies
7h11m

Datetime and phonenumbers are two subjects that are notorious for how complex they are despite seemingly simple everyday concepts

PlunderBunny
5 replies
20h23m

I'm sure it's more complicated than "we didn't think about leap years", but it certainly sounds pretty amateurish.

Old programmer rant: In my day, we fixed the Y2K bug - we went to the future and back several times a day!

mustntmumble
2 replies
16h50m

It does sound amateurish eh? I do most of my business logic inside Microsoft SQL Server Stored Procedure, and MS SQL just takes care of date pretty well.

But then, come to think of it, you don't need to use SQL to have good date logic. C# and Java both have excellent date handing libraries. I don't know about C++, but I'd be surprised if there was not a modern date library for C++, so I am of the opinion there should be no excuses for software not to work on the 29th of Feb.

throwaway2037
0 replies
13h36m

but I'd be surprised if there was not a modern date library for C++

The standard library now includes <chrono>. AFAIK: It was mostly written by Howard Hinnant. He now has more date/time libs that expand upon <chrono>: https://github.com/HowardHinnant/date

SoftTalker
0 replies
14h37m

Yes if you're writing your own date/time routines, dealing with dates as seconds since epoch, or anything like that you're going to get burned.

Use date handling functions and libraries that have been developed by people who know how to do it and have been battle tested.

kevin_thibedeau
1 replies
18h42m

In your day people weren't doing everything with string ops in JavaScript.

PlunderBunny
0 replies
18h22m

Oh, the progress we've made!

tgtweak
6 replies
13h13m

I have a friend who was born on Feb 29, and in Quebec your driver's license fees must be paid on or before your birthday or your license is effectively revoked (It's a convenient reminder). He was on his way to pay them on the 29th and got pulled over for having an expired license... after some awkward common confusion with the police they came to the conclusion that the license bureau moves your "reminder" birthday up by 1 day when the actual day is on Feb 29, instead of back to March 1st, so they don't miss out on 3 years of license payments for leap year birthday citizens.

The cop had never encountered this before (1/1460 chance of occurring * the odds of being pulled over on that day)

I don't think they ever patched this, so watch out if you're a leap day license fee procrastinator in Quebec!

xandrius
3 replies
9h50m

I mean, they could have paid it any day before then, right?

I would have just gone on the 28th and be done with it.

badcppdev
1 replies
9h27m

Let me tell you about this human trait called procrastination.... actually I just have to do something first

tudorw
0 replies
8h34m

Pay By = Wait Until

stevage
0 replies
9h43m

Sure...if you knew about this bug in the system.

redox99
1 replies
11h15m

Wouldn't the drivers license have the expiration date printed on it?

foxyv
0 replies
1h57m

What if the expiration date doesn't exist? Does the license just never expire? Wouldn't that be funny?

pavon
6 replies
21h29m

No, but some of our software writes data to rotating directories named after the date, and while doing some manual debugging on a test system, it started failing to create these directories the first time it rotated on Feb 29 UTC. Turns out it just happened to run out of disk space at that time, but I had myself convinced that it was a leap year bug for over an hour. :)

Imagenuity
5 replies
14h10m

LOL, a good example of correlation does not equal causation.

markb5
4 replies
3h45m

It's not. There was no correlation at hand here - this was just a coincidence

joks
3 replies
3h20m

I would think it's an edge case of correlation, but still correlation (100% of the time it has had this error, it was on a leap day, 0% of the time it was not)

markb5
2 replies
1h34m

It might appear as a correlation due to sampling error, but the two variables have no dependence with each other. There is no correlation with it being February 29 and the bug that was described.

sd9
1 replies
51m

I think that's exactly what OP is trying to say when they say 'correlation, not causation'. There is no causal link between 29th February and the bug, but they happened at the same time (were correlated, i.e. had the relationship that they happened at the same time).

This is a fairly typical informal usage of the word correlation in my experience, and while it might not be _technically correct_ (I don't know, I'm not an expert), it's an often enough used idiom.

markb5
0 replies
26m

"Correlation does not equal causation" is a very important and pertinent concept in statistics, and I think we should aim to actually understand the concept instead of just trying to warp the meaning of the words to fit the example

The bug simply was not "a good example of correlation does not equal causation" as any statistician would use the phrase. That's my only point. OP is free to type whatever words he wants into the comment box and press send

Smoosh
6 replies
20h56m

I certainly did. There is a batch process to cull old records. It checks for customers who do not have a date of death recorded but are > 130 years old, as it assumes that we weren't informed of their death.

It takes 130 years from the current date and uses that in an SQL statement to compares it to the date of birth. DB2 doesn't like 1894-02-29.

Apparently it happens every 4 years, but no-one can be bothered to fix it.

verbify
5 replies
19h25m

A simple fix would be to change it to a multiple of 4 (e.g. 124 years). Then it would fail every 100 years.

gield
2 replies
18h16m

2000 was a leap year so it would not fail in 2100. But it would indeed fail in 2200/2300/2400 as 2100/2200/2300 are not leap years.

addandsubtract
1 replies
17h36m

But then it's someone else's problem.

topaz0
0 replies
17h31m

Most likely nobody's problem, really.

samatman
0 replies
19h0m

128! It was right there!

offices
0 replies
7h59m

And it's still enough to include Jeanne Calment's supposed age.

stop50
5 replies
21h57m

Can't you just backdate some servers to confirm the fix?

murderfs
2 replies
21h43m

That's generally risky to do nowadays because of things like TLS certificate expiration.

Retr0id
1 replies
21h30m

In a few hours you'll be able to backdate to "yesterday", with very low chances of hitting cert expiry issues (but I wouldn't be surprised if OP's issue involves components outside of their control or ability to test end-to-end)

murderfs
0 replies
20h57m

I should have written something along the lines of "validity date ranges" instead of expiration: you're much more likely to run into problems where you run into a certificate that was issued in the future relative to when you think is now.

abathur
1 replies
21h41m

Not directly related to leap year, but a couple weeks ago I set up a script for testing notification behavior that used libfaketime to simulate runs at different times.

I guess this might be less-trivial if you've got a distributed multi-service architecture and perhaps also depend on APIs that aren't under your control in the first place.

stop50
0 replies
20h19m

Set up a backdated timeserver and use that to sync time

napoleongl
5 replies
21h41m

One of the largest food store chains in Sweden had their entire card payment go down because someone forgot to handle leap years!

livrem
3 replies
21h34m

Wikipedia says they are "the second largest retail company in the Nordic countries[citation needed]". Pretty big company anyway and embarrassing for them. Would love to learn more about what the bug was, but I guess they will never say.

https://en.wikipedia.org/wiki/ICA_AB

livrem
0 replies
20h24m

No disagreement, just additional information.

napoleongl
0 replies
8h53m

Tbh I was just too lazy to find its place in the rankings. It sure is a big business anyway

hinkley
0 replies
21h26m

This isn't even one of the weird years!

Is this why we can't have nice things?

mrwizrd
5 replies
18h48m

Unless you're in your 70's, YouTube doesn't allow you to buy premium if you were born on a leap year, because their age calculation is broken, and it thinks you're under 18. Google One works fine. Support will suggest that you change the birthday on your Google account, which breaks account recovery processes that depend on you furnishing matching identity documentation. Mind-boggling.

Because nobody at YouTube has apparently ever encountered this problem, I ended up having my partner buy a family plan. As much as I hate paying so much a month for YouTube of all things, screen-off background play is a paid feature on iPhone, having one of the two accounts on your TV showing ads is absolutely infuriating and I'm not sure I fancy risking an account ban for anything they can associate with someone costing them ad revenue.

mateo1
1 replies
16h44m

I wouldn't expect google to mess this up but then again someone probably calculated value produced vs project cost and tossed this one at the bottom of the pile 10 times already. 66/100k people (0.066%, close to the definition for a rare disease) would be born on 29th of feb on a uniform distribution, probably minus another 5% or so because february is in many places the least likely month to be born into. And out of those people how many actually put in their real birthday? Still odd to mess up a subtraction though.

rvba
0 replies
8h45m

Google is now outsourcing development to low cost countries. They dont care about quality much

mj1586
0 replies
18h28m

Fascinating. I presume you were born on Feb 29 of 2004 or earlier. What did the system do when you tried to purchase? I'm curious how the error manifested. Thanks.

kunley
0 replies
9h28m

That should be a top comment here as it is most annoying and prevalent bug of all presented in this thread.

akincisor
0 replies
18h25m

So you're paying them to not fix a bug in their system, am I reading that right?

bombcar
1 replies
19h46m

We should just do what we do for time changes and do feb 28 over again.

whycome
0 replies
19h21m

Or do leap hours and have a 25 hour clock for a day

dasil003
0 replies
21h27m

Every time I go to timeanddate.com I feel like I see a link to the Leap Day page (https://www.timeanddate.com/date/leap-day.html) that shows the meme-infamous boyfriend-checking-out-another-girl couple, except she's proposing to him! Obviously this happened earlier that day since they're wearing the same outfits, and I can't help but feel bad for her knowing what's coming but unable to warn of the impending train wreck.

TheRealPomax
0 replies
19h47m

I'll take a February 30 if it means every other month is 30 days too, and we just get the extra days as universal, extended winter holiday where no one can legally be required to work because there is no December 31st or January minus-fourth.

Too
5 replies
12h4m

Stupid question. How do these bugs happen?

If you just take the naive approach and calculate everything as unix timestamp deltas, “yesterday” in human terms will still be 86400 seconds ago. No difference leap day or not.

If you use a date library with fancy “subtract one day” functions, it should also be handled automatically. Just like you don’t have to care that March has 31 days and April 30? No difference if leap day or not.

Someone must have spent a lot of effort to manually create date logic, hard coding the number of days in a month or something?

Only other edge case is if someone takes a 2024-02-29 timestamp and modify the year part, without using date library to do so. That should be rare, only use case is a yearly report. That’s not something that should take down the whole billing system.

rfoo
1 replies
10h34m

Only other edge case is if someone takes a 2024-02-29 timestamp and modify the year part, without using date library to do so.

Date library does not help here, for example, both Python and Java's date library [0][1] have only "days" in their timedelta/Duration constructor. Month and year are ambiguous. What would you do if you want someone's birthday this year? The most obvious way:

    birthday: datetime.date
    birthday_this_year = birthday.replace(year=datetime.date.today().year)
is just broken. The second line throws.

[0] https://docs.python.org/3/library/datetime.html#datetime.tim...

[1] https://docs.oracle.com/javase/8/docs/api/java/time/Duration...

javanonymous
0 replies
6h59m

The Java library actually supports this case.

It may not have the convenient "years" method directly, but you can add an arbitrary unit of time quite easily

Example with duration:

    Duration.of(1, ChronoUnit.YEARS)
Example with datetime:

    today.plus(2, ChronoUnit.YEARS)
It even supports decades, centuries, eras and half days :-)

For those curious about how it handles leap years:

    var leapDay = LocalDate.of(2024, 2, 29)
    leapDay.plus(1, ChronoUnit.YEARS);
   
    // ==> 2025-02-28

    var lastYear = LocalDate.of(2023, 3, 1);
    lastYear.plus(1, ChronoUnit.YEARS);

    // ==> 2024-03-01

    var lastFeb = LocalDate.of(2023, 2, 28);
    lastFeb.plus(1, ChronoUnit.YEARS);

    // ==> 2024-02-28

    var firstFeb = LocalDate.of(2024, 2, 1);
    leapDay.with(TemporalAdjusters.lastDayOfMonth());

    // ==> 2024-02-29

perlgeek
0 replies
10h30m

Only other edge case is if someone takes a 2024-02-29 timestamp and modify the year part, without using date library to do so. That should be rare, only use case is a yearly report.

Another use case: you create a pair of cryptographic certificates with a validity period of 1 year. The other side rejects the certificate because of an invalid date. This happened 12 years ago to Azure: https://azure.microsoft.com/en-us/blog/summary-of-windows-az...

lancebeet
0 replies
11h25m

I've seen many date-related bugs similar to these and in very few cases it's as simple as "one developer was incompetent and did something stupid". Incompetence may be part of the problem, but in the background there are often data sources or services that provide the data in non-standard or unpredictable ways as well as specific business requirements that complicate the process.

Karliss
0 replies
10h26m

One case I can imagine is if the authors of law/rules that the code tries to implement were trying to be clever and defined the specific way this edge case needs to be handled. In such situation developer is likely forced to do some manual logic instead of the straight forward whatever happens when offsetting timestamp by 365 days using time library.

whatever1
4 replies
15h38m

Why this is not a global holiday? Let's all come together and agree to do nothing on this bonus day. Calendar Problems solved.

pizzafeelsright
2 replies
14h44m

We should get it off work. We aren't getting paid for the extra day of work right?

whatever1
0 replies
12h4m

Exactly. Off the books for everyone.

chgs
0 replies
8h51m

No power, no hospitals, no internet, no phones, no care homes etc.

IvyMike
0 replies
12h26m

Even those "24/7/365" people technically agree, today is a day off.

pastureofplenty
4 replies
21h3m

Yes, I have a bot that posts daily San Francisco weather records to Mastodon. It did not post as scheduled today. This is because I am looking at all the high temperatures, low temperatures, and precipitation on today's date from 1875 (about as far back as there are digitized weather records I can work with) to the present. Since there was no such date as February 29, 1875 it is throwing an error.

netcraft
3 replies
18h27m

I just dont get the “daily” weather records thing. Meteorologists talk about them constantly but theyre completely meaningless right? who cares what this particular day of the year highs were? its just noise! at least do it on a weekly resolution instead but even that seems so noisy itd be meaningless.

sorry, this has nothing to do with you, just a pet peeve.

jrockway
1 replies
18h6m

People like them because they happen more often. "This is the hottest February 29th on record!" but it's not the hottest February 28th or March 1st.

Compare that to something more mathematically rigorous: "Today is warmer than 98.72% of days between February 25th and March 5th". Nobody's going to click that link.

DANmode
0 replies
18h0m

Your words read like you're disagreeing,

but the idea seems like it's agreeing.

jasomill
0 replies
17h57m

As weather conditions are roughly cyclical with a period of a year, this doesn't strike me as a particularly unusual thing for a weatherperson to mention in passing.

Though you're correct in that year-over-year weather changes and daily maxima lack the significance of long-term climate trends.

hannob
4 replies
9h36m

I know I'm late to the party, but I have a Python script that creates a security.txt for one of my own project, and it sets the "Expires" date to one year in the future.

Old code:

expires = datetime.datetime.now(tz)

expires = expires.replace(year=expires.year + 1)

It broke yesterday, throws an exception ("ValueError: day is out of range for month"). It's kinda obvious that it does.

Fixed version code:

expires = datetime.datetime.now(tz) + datetime.timedelta(days=365)

expires = expires.isoformat(timespec="seconds")

Now we're just going 365 days into the future. Of course, this has a slightly different meaning and outcome, we are not always ending up on the "same date next year". But in this use case it doesn't really matter.

willsmith72
1 replies
6h42m

There's the same in python, but if you wanna write shitty code you can always get around it

wwilim
0 replies
1h0m

Is it just me or does .NET have the most sane standard library for dealing with dates? Until you get into timezones that is

bauble
4 replies
18h58m

I had a unit tests for a Java LocalDate that was being increased by one year. It checked whether the month and day were the same, and failed because the current day (29) didn't equal the year-hence one (28). I changed it to check that the difference between the days was less than two.

nathanwh
3 replies
18h55m

Previously your unit test was broken one day every four ish years. Now it's broken every day :)

bspammer
2 replies
18h44m

A unit test shouldn’t even be depending on the current date in the first place

yen223
0 replies
17h57m

This is a hard-earned lesson, but it's true.

Instead of doing

  def do_something_with_date():
      now = datetime.now()
      return now - timedelta(days=2)
you should do

  def do_something_with_date(now):
      return now - timedelta(days=2)
and explicitly pass in edge-case dates into the `now` param in your unit tests.

Alternatively, if you're using Python, use the freezegun library to fix the current time in tests: https://github.com/spulec/freezegun

dimaaan
0 replies
18h2m

Right, fixed such test today

animal_spirits
4 replies
15h17m

Didn't see it mentioned here but cloudflare sent me an invoice today and the attached PDF was titled cloudflare-invoice-1970-01-01.pdf :)

mj1586
1 replies
13h15m

Was the content of the PDF correct? Or did it also have some strange dates in it?

animal_spirits
0 replies
2h11m

yeah everything inside the pdf was correct

guappa
0 replies
9h33m

Their 32 bit time_t ran out sooner than expected!

2muchcoffeeman
4 replies
21h10m

Why are there so many stories about leap year bugs?

bombcar
1 replies
19h44m

It’s strange to me, it hasn’t been than long since a leap year and I don’t remember as many last time.

bhpm
0 replies
19h15m

It’s the first go-around for the jr devs who went to school during the pandemic :)

ImaCake
1 replies
21h1m

Because programmers take shortcuts. Its easier to type x - 365 than to import Calendar and then date(x) - timedelta(1 year).

dimaaan
0 replies
18h58m

And standard library design errors also.

Properly designed date/time API invented relatively recently.

System.DateTime (.NET) - 2002 | System.DateTimeOffset - 2005

Joda time (JVM) - 2005 | java.time - 2014

Temporal (JavaScript) - still experimental

tdhopper
3 replies
21h42m

My sister is staying in a hotel and all the keycards stopped working.

ant6n
1 replies
19h50m

What happens in a situation like this? Does the staff issue physical keys? Do the doors even have manual locks? Do the staff walk every body to their room?

atomicstack
0 replies
16h0m

About a year ago I stayed in a hotel and the door lock started misbehaving one morning while I was at breakfast. Went to the front desk, got a new card, went back to the room and discovered it still didn't work. After doing that two more times, someone was sent up to the room with a mysterious, palm-sized device with a USB cable hanging off it, which they plugged into a well hidden USB port on the bottom of the lock. The device performed some black magic, and after about 30 seconds a light on the lock changed colour from orange to red and it started functioning correctly again.

mj1586
0 replies
18h6m

This also happened on Leap Day 2020 with Onity locks used in Crown Plaza Hotels. See https://i.imgur.com/GI5A3jW.png. I wonder if it's the same issue never fixed? Can you share with us the hotel chain and/or the lock manufacturer? Thanks.

pizza234
3 replies
18h44m

Yes, an amusing one: the Android app for the Berlin public transport, on the 29th, listed the results with the date of the previous day (28th).

The funny thing is that the list is prefaced by a banner saying that this is a known bug, and the results actually refer to the 29th.

Interesting way to workaround a bug :)

pizza234
0 replies
12h0m

Yes :)

rahimnathwani
0 replies
18h3m

The app was probably designed to be able to show an emergency banner if ever needed. Easier to change that message than fix a complicated API.

habibur
3 replies
17h58m

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_lodsb
2 replies
17h0m

your function returns 29 days for every year not divisible by 400

wruza
1 replies
14h9m

!(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
0 replies
11h26m

Oops, you are absolutely correct!

acutesoftware
3 replies
20h30m

Our ETL process is heavily monitored so we never miss a days data, but we got a surprising error "cant build aggregates - missing data, aborting MV refresh, data will be a day old". It was the year to date (YTD) calculation - no data for 29/2/2023 to compare to today.

bombcar
2 replies
19h49m

This is why -365 days can be better than -1y.

jedberg
0 replies
18h27m

Until tomorrow when your system is now off by a day for the next 365 days.

OJFord
0 replies
19h37m

Frankly unless you've considered it ahead of time and thought you'd handled it, IMO you want the error. What's the correct thing to do here? I don't think it's necessarily -365d, it might be, but if I was GP I'd be glad for the chance to consider it and decide what's correct - instead of it just blowing up or even worse silently going whichever way's wrong and undetected for a while.

EnigmaticLion
3 replies
16h37m

We have a rails 6 app, and there's a test that essentially expects time_ago_in_words(1.year.from_now) to return "about 1 year" (as part of a user facing message). The test failed. I thought it's a flaky test but i was able to reproduce it locally. Turns out executing that code on a leap day returns "almost 1 year" instead. Can test it in rails console if you are interested:

  irb(main):001:0> include ActionView::Helpers::DateHelper
  => Object
  irb(main):002:0> distance_of_time_in_words(Date.new(2025, 2, 28), Date.new(2024, 2, 29))
  => "almost 1 year"
  irb(main):003:0> distance_of_time_in_words(Date.new(2025, 3, 1), Date.new(2024, 2, 29))
  => "about 1 year"
  irb(main):004:0> distance_of_time_in_words(Date.new(2025, 2, 28), Date.new(2024, 2, 28))
  => "about 1 year"

DinaCoder99
2 replies
16h26m

distance_of_time_in_words(Date.new(2025, 2, 28), Date.new(2024, 2, 28))

Curiously, this is also not quite a year, even though the days and months are the same.

mr_toad
1 replies
16h10m

It’s probably comparing the number of days between the dates with the number of days in a year, which would usually work.

zeroCalories
2 replies
18h50m

Remember, always use a library for cryptography, payments, and date calculations.

interbased
0 replies
15h9m

Yup. I use the datetime module in Python and didn’t need to do anything extra.

iknowbettah
0 replies
1h43m

wrong! always roll your own crypto!

qwerty456127
2 replies
21h13m

Yes - I triple-checked the calendar to verify my suspicion this February might have 29 days. The result was always negative - it seemed 28. Then February the 29th actually came. A bug apparently occurred in my mind.

chatmasta
1 replies
19h10m

I can also never remember if "leap year" means 29 days or 28 days, and which one is normal. I probably checked that twelve times this week. And I was mildly surprised when I noticed that March 1 was Friday and not Thursday...

iforgotpassword
0 replies
10h51m

As a child I somehow always forgot and thought 27 was normal, and then one year the calendar in our kitchen showed 29 days. that was kinda confusing.

mrlucax
2 replies
18h36m

Our credit card invoice system shifted all invoices that were due 28th to the 29th of February. Still trying to figure out what happened.

jedberg
1 replies
18h24m

Are they monthly invoices? Most billing systems will bill monthly recurring bills that have an anniversary of 28, 29, 30, or 31 on Feb 28. Maybe your system was actually doing the right thing and putting only 29, 30, and 31 on Feb 29.

mrlucax
0 replies
18h18m

Yes! It's anniversary based. What went wrong actually was the notification part. As Feb 29 was not an expected anniversary, it didn't schedule any notification to be sent.

mindcrime
2 replies
17h28m

Last night around 8:00 PM I noticed the time on my Linux laptop was wrong. I tried to reset it manually and got a "Cannot set current time" error. Closed the dialog and a minute or two later the time reset to the correct value. I shrugged it off as something random.

Then today I get home from work, un-suspend that same laptop and the time and date are both wrong now. It has it as around 10pm last night. Turn off auto updates and turn that back on, and nothing happens. Wait 4 or 5 minutes, nothing happens. So I finally decided to reboot, which does indeed clear things up. Only then did I remember that today is Feb 29th and make the connection that this might be related to the leap year.

Can't say for 100% certain that it was, but it would be one hell of a coincidence otherwise.

swores
1 replies
16h48m

If you have date/time problems that are unrelated to leap years, there's a 1/~1,461 chance of it happening on a Feb 29th.

Given how many devs/techies/linux users/(and even non-techy users of tech) will encounter random time or date related bugs and problems every year, it would be surprising if there weren't a few people getting that coincidence every time a Feb 29th rolls round (or put another way, it seems likely that there's more than one person in the world having a similar "no idea what caused that" date/time bug every day of the year, including this one). So maybe related, but I wouldn't call it one hell of a coincidence if it's not related.

mindcrime
0 replies
3h11m

And the doubly sad thing is, I'll almost certainly never really know. But such is the way of life.

koliber
2 replies
7h31m

Many years ago I visited Laos. We crossed the border at a rather remote and little-used border crossing.

Laos issues 30-day tourist visas on arrival. We arrived on February first and I have a Laotian visa valid until February 30th, 2011.

Not a leap year bug but a February bug. Ended up being inconsequential, but still makes for a fun story.

niij
1 replies
4h12m

You have a picture?

gnicholas
2 replies
19h19m

I just checked and realized I have zero annual Stripe renewals that have come through so far today. Not a big surprise, since most of our customers are on monthly subscriptions.

I have wondered about how Stripe handles months with differing numbers of days (for monthly subs), and leap years (for annual subs). Do they accelerate renewals in short months, so that February 28 has all the renewals that normally happen on the 29th-31st of other months? Or do they happen on March 1?

jedberg
1 replies
18h47m

Do they accelerate renewals in short months,

Yes. They bill on the last day of the month if your anchor date is past that. In fact most billing systems do, which is why Feb 28th is the best day to load test billing systems. Because you'll get four days worth of renewals on one day.

Interesting that you don't have renewals today, I wonder if they did them yesterday and have a bug?

gnicholas
0 replies
17h42m

I do have plenty of monthly renewals, just not annual ones. I actually went to see if I'd had any annual renewals on the Feb 29, 2020, and it looks like I had just one, but they lapsed due to credit card failure. Fingers crossed that we get a signup today and can have a renewal on our next Leap day!

evanb
2 replies
21h39m

Payroll software at work had a one-off planned maintenance day today, presumably to avoid worrying about any bugs.

zie
0 replies
20h38m

Today is a payday for us, worked great!

dasil003
0 replies
21h32m

lucky it didn't fall on a payday eh?

bxparks
2 replies
21h20m

I can understand getting the years 2000 (leap), 2100 (not leap), 2200 (not leap), and 2300 (not leap) wrong. But getting the year 2024 wrong is, disappointing, to put it diplomatically.

samatman
0 replies
18h57m

Those are harder to get wrong, since leap year bugs are almost always from consumers of dates. To screw up a not-a-leap-year-year you'd need to produce a bogus February 29 on a real March 1. Date producers tend to understand how the calendar works better than that.

JohnFen
0 replies
20h35m

That's putting it very diplomatically indeed.

KomoD
2 replies
21h37m

Yes.

During the morning on Thursday, no ICA store in Sweden could accept card payments. Instead, you had to use cash, Swish or pay via their app.

The reason behind the problem was an internal problem in the payment systems at ICA as a result of an extra day in February, leap day.

ICA being the biggest grocery store chain in Sweden

guappa
0 replies
9h39m

And people in sweden look at me weird when I say I keep some cash around.

At least it wasn't 3 days like when Coop's provider got hacked. They also handle our pay checks at work… makes me feel so safe :D

FumblingBear
2 replies
21h26m

This one is rather specific, but a game rhythm based Final Fantasy game called Theatrhythm Final Bar Line is simply not allowing people to play today because it has an internal system that awards prizes for specific days and they didn't handle the case of what to do when it's on a leap day. You can boot it up but can't actually play the game as a result.

Not working on the game or anything but found it moderately amusing as someone who owns the game!

addandsubtract
0 replies
17h42m

That's why they had to release FF7R2 today. It was planned all along /s

userbinator
1 replies
15h35m

It's scary how much code out there is less than 4 years old, and even scarier how much of it is because someone decided to somehow rewrite it unnecessarily and thus introduce this bug. I don't even want to know how many people think the code they wrote will be in use for more than 4 years.

ghewgill
0 replies
14h46m

On the other end of the scale, the code base I worked on today has seen at least 7 separate leap days in production. Last week a manager asked if we expected any issues with the leap day, and we all just kind of laughed (and politely said no).

o11c
1 replies
21h7m

We got a bunch of close-dated yogurt the other day.

Several were best by 2-27, 2-28, 3-01, and 3-02, but none by 2-29.

jareklupinski
0 replies
20h57m

none by 2-29

traditionally known as the "Angel's Share" :P

n_ary
1 replies
15h24m

Saw my bank book every auto-transfers, like utilities, rents etc.. booked for 28th to be again booked on 29th, i.e. twins appeared. But then those disappeared after the mid-day. Not sure if those were caught and fixed by anti-fraud system as double-charging or was just strange bugs somewhere, but happy that they disappeared, as it would be weird to explain to my landlord about why I decided to pay double rent.

mj1586
0 replies
12h56m

Which bank?

jonathantf2
1 replies
18h37m

Our Sophos anti-virus at work blocked access to every website this morning because of the leap year, had to disable the web filtering to get us back up and running.

fostware
0 replies
18h18m

Yeah, so many "untrusted website" screenshots in the office chat. Half a productive day for staff in Australia

jcarrano
1 replies
19h56m

My Citizen ana-digi-temp from 1985 works perfectly fine and shows Feb 29.... though it thinks it is 1996!

rep_lodsb
0 replies
17h3m

Probably resets every 28 years, that way it can keep track of the day of week (at least until 2100)

hsuduebc2
1 replies
15h17m

Spotify Artist which is app for managing as name states your artist profile should allow you to run promo campaigns but they need to be set till the end of the previous month. Well. 29 February according to spotify is not a valid February date.

I know it's somehow an edge case but it's one which appears every four years so I dont understand how it could be missed by such a big company.

hsuduebc2
0 replies
15h16m

And if someone wanted to point out that I shouldn't let things to last moment.

He would be absolutely right.

dgan
1 replies
19h55m

Yup, all our rolling-year calculations failed because you can't have 29 Feb 2023!

conductr
0 replies
19h29m

These ones are the worst because you'd think they'd be so obvious at time of implementation. Maybe it's just me, I do a lot of comparisons and things like this always are top of mind for me.

austinkurpuis
1 replies
16h8m

My wife’s company had an issue with this today. A couple hours before I read this she mentioned it to me and I just assumed human error was the cause. Then I read this and it clicked. Crazy shit.

rvba
0 replies
8h29m

Well it is human error after all. By the programmers. Oe those who invented the complicated calendar

austinkurpuis
1 replies
15h37m

A charge from something I bought today says March 1st.

johnsillings
0 replies
15h35m

What time zone is the merchant in?

0x54MUR41
1 replies
12h10m

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
0 replies
12h7m

Same thing for us

zzzbra
0 replies
19h52m

Gusto paycheck didn't come in until a lot later than usual... thought this might have been my last day on the job for a little bit, didn't help that my manager and I's one on one was my first meeting of the day heh.

yread
0 replies
11h28m

I got an invalid grant - bad request from google oauth on one of 3 identical servers

xyst
0 replies
21h21m

One of the most common QA test cases when it comes to testing date and time sensitive applications.

wilsonnb3
0 replies
14h36m

my m1 macbook air, which has been powered down for a few months, would not automatically get the date from the time server, which broke some stuff.

set it manually, no problems, hopefully will be able to turn it back on tomorrow

web3-is-a-scam
0 replies
16h47m

I work in scheduling software and had no issues today surprisingly. But we have hundreds of end to end tests that cover daylight savings as well as leap years.

vidanay
0 replies
21h24m

Maybe? My paycheck direct deposit didn't show up until almost 7am. Normally it hits right at midnight.

vermilingua
0 replies
11h53m

The calendar lockscreen widget on iOS reported an event that had already happened as upcoming on March 1st, pretty minor

vallard
0 replies
14h10m

Using Google docs it usually autofills the date for me but today it couldn’t as I typed the date the calendar widget came up. No Feb 29! I typed 2024-02- waited and it didn’t show up. 2024- then autofilled 2024-03-01

tr33house
0 replies
19h34m

I had a few [datetime].replace(year=[current year]+n) in python where n is not divisble by 4 e.g. 2,10

This is in code we use for scheduling

tootie
0 replies
14h28m

Yes. We had some test failures. Test setup was to create records for today, yesterday, last week and last year and make sure they are generated correctly. Well last year's date didn't match today's. Easy fix but it was hilarious.

thayne
0 replies
11h17m

Ran into a bug where some code was taking an hour long interval and subtracting 1 year from the start and end times. But the time library handled subtracting a year from Feb 29 as converting it to Feb 28th of the previous year, at the same time. So on-call got alerted because a job failed when an exception was thrown because the start time was after the end time. Fortunately, other than the alert, there wasn't any negative impact. Although, I think if this isn't addressed it may cause issues next year when it includes a bigger interval of time than expected on March 1st.

templon
0 replies
5h7m

Yeah, I have a Python script for personal use, and briefly could not figure out why it was crashing. The reason : I was using

class datetime.date(year, month, day)

which was attempting to generate "today, one year ago" by reusing the current month and day, but replacing the year with year-1.

talentedRed
0 replies
11h4m

My "smart"watch froze at 23:59 28th Feb

shekispeaks
0 replies
18h13m

Yes, we had a test fail when generating `12 days ago` strings from a past date.

shafin_
0 replies
7h34m

probably teams had one, today it was showing me all meetings from yesterday

sfmike
0 replies
11h26m

shopifies calendars and some ad dashboards are showing 2 days in view instead of 1 for today/yesterday

seydor
0 replies
12h5m

Years ago i ran a script to fill a db table with entries for each day by incrementing a timestamp by 86400. It skipped the 29th of this year

rezonant
0 replies
18h38m

after the QA confirms the fix in 2028.

Dang, your QA team is fast.

ra-jain
0 replies
15h12m

My university login website now does not allow me to login

projectileboy
0 replies
13h20m

“Anyone who thinks programming dates and times is easy probably hasn’t done much of it.” - Peter van der Linden, Expert C Programming

phigcch
0 replies
9h54m

According to the Intranet, it was everybody's birthday yesterday.

perakojotgenije
0 replies
8h24m

My Casio F-91W thought it was March the first and got me confused for a moment. But other than that I saw no other bugs.

oxley
0 replies
16h57m

I have a daily reminder set up in Apple’s Reminders app and it didn’t trigger today.

obiefernandez
0 replies
19h41m

Uber is down in Mexico City

nameoda
0 replies
21h13m

My monthly bus passes for both February and March did not work in Dallas today. The driver was aware of the issue and just waved me in.

mulmen
0 replies
10h31m

[delayed]

mttpgn
0 replies
14h40m

Python script using datetime crashed with a "ValueError: day is out of range for month" exception.

moralestapia
0 replies
19h29m

I did, actually!

A couple date form fields on AWS had their date incorrectly set to 2024/02/28 instead of 2024/02/29. Not mission critical, but it is something :D.

mirthturtle
0 replies
18h8m

Found one on iMessage! Wished former coworker a happy birthday, and it said, "Siri found a birthday: March 1". Though when I pressed update, it correctly marked it as the 29th.

mirekrusin
0 replies
21h52m

We had test failing that had to be skipped and worked out in the background.

masklinn
0 replies
12h11m

Had a pair of tests break CI.

At least one of them was the test, code it was testing did its job fine but test could not cope with February 29th. Obviously the test is broken in two different ways: it fails on Feb 29 and more importantly tests the behaviour on $current-date so only tests edge cases on the day of.

Other I didn’t follow.

marcoberi
0 replies
6h57m

Breaking News: The legendary report from 2017 finally cracked yesterday:

queryset.filter(user__last_login__gte=today.replace(year=today.year - 1)).count()

Meanwhile, in the betting world, someone actually placed a bet on the day of the week for February 29, 2020.

madduci
0 replies
12h59m

Yes, the local transport Timetables App was showing the 29.02 routes as 28.02 and they have put advice on this problem

lynx23
0 replies
11h29m

gpt-4-0125-preview was the output from "date" and commented that my date implementation must be broken because 2024 is not a leap year and therefore the 29th isn't a valid date... Go figure.

lukan
0 replies
9h8m

I unsubscribed from Netflix and was supposed to have it till the end of februar. But yesterday the 29. there was already no more access ..

Quite trivial, but still a bit ridiculous.

lucas_membrane
0 replies
20h20m

My desktop machine did not time out overnight last night and require me to enter my password to resume wasting time this morning.

lttlrck
0 replies
16h18m

EA Sports WRC.

Crashes on launch. Put the system clock forward and it works... it boggles the mind.

loxdalen
0 replies
8h21m

I have a small hobby project that scrapes concerts on various venues websites.

Many of the websites don't write out which the year the concert takes place, so in python I will: try the current year and see if the date has already passed, and in that case I try the next year.

Of course feb 29th is an issue in this case, so some of my scrapers modules crashed.

keepamovin
0 replies
12h49m

Yeah, the AirBnB where I'm currently started renovating the apartment upstairs. I guess that's a bug. In the ideal life, that wouldn't have happened hahaha! :)

karlosmid
0 replies
12h54m

Hi! In my internet banking, I needed to schedule one invoice for the last working day of march, 28th, Friday. System responded that this is Sunday so invoice could not be scheduled.

juanpicardo
0 replies
1h2m

my home assistant integration for solar/energy monitoring did not register any data for feb 29. from midnight to midnight

jrmylow
0 replies
19h7m

Pandas CI broke today because of the leap day and testing for datetimes. Pretty similar story to the other Python examples.

jonathanlydall
0 replies
8h2m

Today is the start of the new tax year here in South Africa and my brother wanted to draw the last years worth of transactions from a local financial institution to be able declare his tax.

Setting the date range from 2023-03-01 to 2024-02-29 was not permitted as it says the date range must be within 12 months. Of course a general limit of 12 months is a bit of a WTF too.

jokethrowaway
0 replies
8h49m

My (cheap, digital) watch thought it was 1st of March.

Funnily enough when I went to change the date the watch allowed me to select Feb 29th. I wondered if it had supports for leap year and it was off by exactly one year but that's unlikely as it didn't seem like cycling through the dates changed it to 29. Most likely it allows selecting manually the 29th but then skips from 28th to 1st of March every year.

All my billing / calendar booking is outsourced to Paddle / Stripe / third parties so no other issues in my products!

jedberg
0 replies
18h56m

and SRE has scheduled a postmortem after the QA confirms the fix in 2028.

:)

jahsome
0 replies
17h30m

I have an old client who called and is having issues with their registration/calendar system.

When the page loads it looks for events two years in the future, which as you might guess based on the context of this thread, simply increments the current date's year by two.

internetter
0 replies
21h38m

I'd suggest not waiting 4 years to publish a postmortem, if you're serious

inciampati
0 replies
21h13m

Yes, in T-Mobile billing, I tried to set up automatic payments on the 26th, but the system both told me that this was impossible (because it was "less than 2 days from the end of the month") and then accepted it, because why wouldn't it.

igammarays
0 replies
11h2m

Surprised no one else mentioned the Cloudflare billing issue today. I got incorrectly invoiced yesterday and the file was named cloudflare-invoice-1970-01-01.

https://www.cloudflarestatus.com/

hiAndrewQuinn
0 replies
8h47m

Yeah! Our friends got married yesterday, and now they have until 2028.02.29 to legally change their names.

hgomersall
0 replies
10h53m

My new pixel 8 needed an update on the 28th. It told me the update would happen at 2am on the 1st March and duly waited an extra day to perform it. I'm assuming standard Android update policy is not now to wait an extra day.

harryquach
0 replies
13h43m

A few unit tests broke, nothing major.

golergka
0 replies
15h46m

Reading the comments here and can't believe that so much software still has these bugs. 2038 is going to be FUN.

francisduvivier
0 replies
19h28m

Now that you mention it, the payment system was not working in a ski resort restaurant in Switzerland this noon.

They had to switch to cash.

forlorn
0 replies
15h51m

Uniting time zones in Kazakhstan today looks like more of a headache, at least to me.

ezfe
0 replies
17h37m

Unit tests failing because of scenario that offset a date by a number not divisible by 4 and compared...

er4hn
0 replies
18h4m

A coworking space I signed a contract for starting on March 1st sent me an email on 02-28 telling me my membership starts tomorrow and welcome on board.

edgarvaldes
0 replies
21h13m

Just AFTER reading about Casio watches in this thread I looked at mine. Sure it displays the date as March 1.

dvko
0 replies
11h57m

My daily crontab at just after midnight UTC did not run yesterday. I wrote it off as a server hiccup, but now you got me thinking it might be related to leap years…

dontupvoteme
0 replies
10h51m

We did but I only learned of it today! Completely broke a lot of systems until they set the day to March 1st and back

djmips
0 replies
8h57m

I got paid early. Is that a bug?

davidbanham
0 replies
21h3m

My suite failed this morning on an obscure test of a function that converts between ages and dates of birth. Took me ten minutes of head scratching before I realised it was Feb 29th.

’’’ + if time.Now().Month() == time.February && time.Now().Day() == 29 { + t.SkipNow() + } ’’’

Fixed.

davchana
0 replies
21h28m

My Casio F91W I assumed would know that year YYYY is leap, and would show 29th as Date. No, it showed 1 as in March (it doesn't show months). I had to manually set it back to 28th so that tomorrow it shows correct date.

To be fair, it doesn't ask for year anywhere in settings. It simply doesn't know what year it is.

davchana
0 replies
19h57m

I am gald that in excel, deleting a day from March 1st automatically gives Feb 29 or 28 depending on the year in formula. Before that, I struggled a lot to find last day of month by tracking if its a leap year or not, and keeping an array of months & number of days. Now I simply add 1 to month, and from resulting daye I subtract 1 day. The Date value of that gives me 31 or 30 or 29 or 28.

chompas
0 replies
7h58m

I was doing an online check in with the national Argentinian airline. My wife’s and I data was already in the system from the previous checkin. When we were about to confirm we noticed that both of our birthdates where off by one day earlier. I can’t confirm it was related to the leap year but I also cant find another explanation.

chiph
0 replies
18h52m

I had to renew my vehicle registration this month. You usually have until the last day of the month to get it done. But this year the state of North Carolina said that was the 28th, not the 29th.

carlossouza
0 replies
18h1m

On AWS Cost and usage control panel:

Forecasted month end costs

There isn't enough historical data to forecast your spend
bun_terminator
0 replies
21h21m

Yes, a few mildly bad things go wrong on a feb 29th. Everything that handles stuff a year from now for example. Pretty bad for a planning program. But our customers noticed and avoided that. Codebase is too ancient and brittle to even attempt to fix. Or at least boss doesn't want to invest time in it.

baristaGeek
0 replies
16h22m

Colombia's largest airline (Avianca) printed today's tickets with the 1st of March as a date

barbequeer
0 replies
8h51m

I don't know if it was a Leap year bug but after midnight my wife's phone still said Feb 29th even though it should have switched over to March 30th at 00:01

bagels
0 replies
9h47m

Didn't even realize it was a leap day until I saw this post.

axegon_
0 replies
9h15m

Not today but several years ago while lending a hand on a project that was wildly overdue and the guys needed all the help they could get. Disclosure: it was not in software that was in production yet(otherwise you would have likely heard and been affected by it by now I suspect). The software's purpose was dealing with commercial airlines - routes, connections and all that. The travelling salesman problem basically. The software was meant to replace an antique system which no one knew how to maintain since in 2020 it was still running on mainframes and written in fortran. There were specifications on how the system worked but there was no one who could even read the code. Anyhow, the way dates were stored, read and calculated was absolutely insane. I can't recall what the exact deal was, but each date was represented with either 4 or 5 bytes with some really awkward algorithm to make it into something meaningful. With a bunch of additional patches surrounding Y2K.

Unfortunately it was a lot more subtle than getting March 1-st instead of Feb 29-th. Each date was calculated with a dynamic offset depending on the month and year. So during leap years, everything was fine until the 14-th of May at 01:00 UTC. The second the clock hit, 14-th of May at 01:01, all hell broke loose incrementally as time want on until the end of each year. The weird string representation for Nov 1-st was being calculated as January 3-rd for instance. But as soon as the clock hit January 1-st, everything went back to normal. It took 6 people 2 days to figure it out. As you might expect, this was not mentioned anywhere in the documentation.

I'm not sure what has happened ever since, but if the system made it into production and you didn't get stuck in an airport... You're welcome lol

asynchronous
0 replies
19h43m

The national law enforcement background check portal was down today, I wonder if the leap day had anything to do with it.

arcboii92
0 replies
18h50m

Pretty much all of the self service gas station terminals in New Zealand went down for the 29th

alvarop
0 replies
17h11m

Not today, but two years ago. Our ocean buoys started calling in from March 2nd on February 28th.

I describe the bug as part of my presentation at the Embedded Online Conference back then: https://youtu.be/RDUQ0w-5Ws4?si=P6gGDhZC3-3KPKq9&t=787

ainiriand
0 replies
10h50m

Fortunately no, we use Carbon in PHP and it is super solid.

WheatMillington
0 replies
18h18m

Yesterday in New Zealand (29 Feb) couldn't fill up my car at two petrol stations - both had self-service terminals that were down because of leap year. Ended up having to go inside at a station at pay the old fashioned way.

Waterluvian
0 replies
19h40m

Yes. Be mindful about if your industrial firmware really needs to know the datetime..

ThrowawayTestr
0 replies
21h49m

A fiber cable was cut so we had no internet for the morning, probably not leap year related.

SolarToaster
0 replies
5h41m

Citi Bank's credit card "Merchant Offers" showed some offers as expiring in "-1 days".

MASNeo
0 replies
19h16m

One of our reporting systems closed month end reporting yesterday. Made everyone mad until they realized things can still be changed today.

JohnFen
0 replies
21h3m

Not a single one, either in the code at work or anywhere else.

Frummy
0 replies
21h45m

The mcdonalds order waiting thing malfunctioned, displayed de52hg04 instead of 088 and I had to wait a lot longer for my order since it flew under the radar for a while until I spoke to them :)

Ellipsis753
0 replies
7h27m

We had a bug on the 1st of this month. Some billing code liked to invoice on the last day of the month and failed to account for this month having an extra day. Interesting it happened as soon as the "leap month" started. Easily fixed though.

AaronNewcomer
0 replies
13h32m

I bought a couple guardian bikes a couple days ago. Their website said they would arrive today, February 1. I assumed it was some kind of weird leap day issue.