Converting YY to YYYY
Year 2100+ shouldn’t be “somebody else’s problem”.
A YY format can represent no more than 100 years.
Think about it as a window. If we take as a base 2015, a number expressed in that format can go from 2015 to 2114.
Therefore,
- If you get a number >= 15, your number is in the 2000s.
2015–15 = 2000, 2000+(any number >= 15) = win!
- But if you get a number < 15, your number is in the 2100s!
2015–15+100 = 2100, 2100+(any number < 15) = win!

Just one more magic trick off the hat,
<any number> mod 100 = last 2 digits
TL;DR:
Note: If you are here, and you haven’t still read (or listened) to Scott Meyer’s “Off To Be The Wizard” book, you are wasting your time ☺
Edit: An important note about date format
Even thought I referred to dates as YY and YYYY in this text, please beware that I wasn’t focusing in the date format patterns that classes like NSDateFormatter will take as input. In that language:
- “y” targets what we all know as a year, and
- “Y” means the rare (for the common human being) “week of year”.
So, beware when using it, or you might get an unpleasing surprise!
And, at this point, it feels mandatory to share this: https://xkcd.com/1179/