4 ms·
Early on in my career, just a year out of school, I, for some absurd reason, had the idea to build my own date library. Primarily, I didn't fully understand th
by encoderer 12y ago
Early on in my career, just a year out of school, I, for some absurd reason, had the idea to build my own date library.
Primarily, I didn't fully understand the date objects and functions available in the languages/libraries i was using so simple things like formatting a string date seemed difficult to me.
This was an awful idea. Dreadful.
I came up with all sort of delightful helper methods to cover common use cases like adding one month to the current date. I made this decision to represent dates internally with a timestamp, so adding a month is easy, right?! No. ...What's 1 month from January 31st? February 28th? Well then what's 1 month from February 28th? The list of edge cases goes on.
Most things in life are more complicated than they, at first, seem.
- dceddia 12y agoEspecially dates.