Netflix datetime formatting bug YYYY vs yyyy

Channel:
Subscribers:
690
Published on ● Video Link: https://www.youtube.com/watch?v=pW4ok1nslIM



Duration: 0:00
50 views
4


UPDATE: After my bug report, Netflix has fixed this issue.

In the last week of December 2021, I restarted my Netflix subscription. Why? Well people wouldn’t stop talking about Squid Game, and I finally gave in.

Then, on my account settings page at https://www.netflix.com/YourAccount, I saw something curious:

Member Since December 2022


Windows 10 Chrome
What? When I made this account, it was still December 2021. Why did it say 2022?

Just to make sure it wasn’t my computer’s fault, I checked the mobile website. Same thing:


iOS Chrome
What’s going on here?

Well, I’m a software engineer, and I’ve actually faced this sort of problem before. It’s most likely because the datetime formatting code is using the YYYY format string instead of yyyy.

yyyy refers to the calendar year, which is almost definitely what you want.

But people often sometimes mistakenly use YYYY instead. (and who can blame them?)

YYYY means something else, and will actually return the next calendar year during the last week of a calendar year if that week contains New Year’s day, which fell on Saturday of 2021.

Just a small UI bug, but it can definitely cause problems in some circumstances! And it would only affect accounts made in the last week of a calendar year when that week contains New Year’s day, so it’s very tricky to track down! Maybe you’ve made this mistake somewhere in your code!