Published Mar 18, 2019

Why Date-ing is Hard

    Dive into the complexities of date handling and time representation as the episode unravels the challenges faced by developers with standards like ISO 8601, explores SQL Server's datetime precision, and offers insights into tech conference engagement and consumption.
    Episode Highlights
    Coding Blocks logo

    Popular Clips

    Episode Highlights

    • Time Zones

      Time zones play a crucial role in data representation and calculation, yet they are often overlooked. Alan Underwood highlights the absence of time zones in many systems, which can lead to significant issues when storing data meant for global representation 1. He explains the importance of offsets, noting that they aren't always in hour increments, as some regions have 15 or 30-minute differences 2. Michael Outlaw adds that time zones can change, such as when regions consider ditching daylight savings time, making it essential to store offsets with UTC 1.

      It's really important to store that offset alongside it and just always go with UTC.

      --- Michael Outlaw

      This ensures accurate time representation regardless of future changes 3.

         

      Date Math

      Date math can be deceptively complex, with potential pitfalls lurking in seemingly simple calculations. Alan Underwood and Michael Outlaw discuss the challenges of performing date calculations, such as determining the number of days past a given date 4. They caution against writing your own scheduler due to the intricacies involved, like leap seconds and varying week lengths 5.

      Scheduling is so hard. It really is. It's so easy to go wrong.

      --- Michael Outlaw

      Joe Zack suggests using tools like timeanddate.com to avoid errors in date calculations 4.

         

      Leap Seconds

      Leap seconds and time adjustments add another layer of complexity to timekeeping systems. Michael Outlaw6. These adjustments ensure synchronization between atomic time and UTC, though they can lead to confusion, as seen with different clocks showing varying times 6.

      The international atomic time is 37 seconds ahead of UTC.

      --- Michael Outlaw

      Alan Underwood also discusses the confusion around midnight, where 00:00 can refer to the start of the day or the end of the previous day, depending on the context 7.

    Related Episodes