Dates, Times, and Comparisons
Date math is like the apple in the garden of Eden. It looks so simple and delicious, and by the time you take a bite, it’s too late to change your mind. Date math nearly brought the world to its collective knees when the calendar flipped over from 1999 to 2000 because the industry wrote code that expressed years with two characters instead of four. Those two characters worked fine until close to the turn of the century. Then, billions of lines of code tried to incorrectly compare the years of 1999 to 2000 in millions of codebases. Since 00 is less than 99, we had a huge problem, one that even had its own acronym: Y2K.
Dates Are Structs
Elixir has plenty of tools for dealing with dates and times, but you need to know ...
Get Programmer Passport: Elixir now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.