
Apple’s latest Watch is crashing and rebooting due to Daylight Saving Time bug - lnguyen
https://www.theverge.com/2018/10/8/17950300/apple-watch-series-4-reboot-crash-dst-bug
======
gargravarr
You might think that a device whose first and foremost purpose for existing is
telling the time, might, y'know, actually be capable of doing so?

------
Unknoob
Last week I noticed that when I tried to create a Date object in Swift using a
Date Formatter and passing in a string with the date where DST starts in my
country it would crash my app.

extension Date {

    
    
        static func fromString(_ string: String) -> Date {
            let formatter = DateFormatter()
            formatter.dateFormat = "yyyy-M-d"
            return formatter.date(from: string)! ///Force unwrap because I never pass invalid strings.
        }

}

Even though I was passing a valid string it still crashed because it couldn't
parse it into a date. I solved the problem by adding a random hour to the
date(All that mattered to me is the day/month/year so I just don't use the
hour/minutes/seconds).

I wonder if it's the same bug causing a boot loop since it's being used by iOS
itself.

