Category Archives: Dates

This post is based on a lightning talk I gave at CocoaConf San Jose a couple of days ago. It's that time of year-- the time when summer time, or "Daylight Saving Time" as we for some reason call it in the USA-- is ending. That time when a developer's thoughts turn to date math and what a pain in the ass it can be. Why is this so hard to get right? It'd be nice to think that dates and times follow predictable routines whose cycles all use nice round (or at least consistent) numbers. However: The universe doesn't care about regular numbers. The length of a year doesn't divide into an integer number of days. Convenient time periods like months are no better. The Earth's rotation isn't entirely consistent. So we have leap years, and leap…

read more →