Why my Netflix account says it was made a year in the future (YYYY vs. yyyy)
2 by seam_carver | 1 comments on Hacker News.
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://ift.tt/9UsVHrW, I saw something curious: Member Since December _2022_ 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: Member Since December _2022_ 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!