Resources from my talk.

Hello!

A picture of me at Apple Park wearing a Please Don’t Rain shirt.

I hope that you enjoyed my talk at Swift Leeds, Don’t Let Time Zones Ruin Your Day (Days?).

Socials

Handle
Please Don’t Rain iconBluesky@chriswu.com
Mastodon iconMastodon@MuseumShuffle@mastodon.social

Sample Project For Custom Calendar and Date.FormatStyle

I made a sample project that uses the techniques I showed for using time zone specific Calendars and Date.FormatStyle.

Chart Alignment Problem

Here’s my blog post about my Swift Charts Alignment Problem.

Chart Accessibility Issue

Here’s my blog post about my Swift Charts Accessibility Issue.

Please Don’t Rain

I had these time zone issues developing my weather app, Please Don’t Rain.

Please Don’t Rain icon

Audience Questions

  • Calendar date operations are almost always optional, when is it likely to fail (return nil)?

The first thing that comes to mind is using a bad time zone identifier.

let ukTimeZone = TimeZone(identifier: "This won't work") ?? .current

Daylight Saving Time shenanigans and converting to a Date from a String also come to mind.


  • What is your suggestion for storing date information where you need to filter data based on local time and use utc for cases like save to calendar?

See next question.

  • ISO 8601 with UTC is the standard to go for when calculating / saving dates for a reason. Have you tried using it? Displaying etc can then be done timezone specific.

On stage I was pretty sure that I used this for storing dates and that indeed is the case. Here is the code I used although it looks like there might be an easier way to do this.

// https://swiftwombat.com/how-to-store-a-date-using-appstorage-in-swiftui/
extension Date: @retroactive RawRepresentable {
    static let theInnerFormatter = ISO8601DateFormatter()
    
    public var rawValue: String {
        Date.theInnerFormatter.string(from: self)
    }
    
    public init?(rawValue: String) {
        self = Date.theInnerFormatter.date(from: rawValue) ?? Calendar.current.startOfDay(for: Date())
    }
}

  • When we become interplanetary, how can I make sure my app works correctly when a user is on Mars, where a day is 24 hours and 39 minutes? Or Mercury, where a day is longer than a year? Maybe I’m taking the conference theme too literally. 🚀

I’ll direct you to the amazing Rob Whitaker.

I can actually answer the Mars time calculations questions. It was one of my first apps!


  • Could you please elaborate on why Apple wants 12:45 as the desired first hour in Nepal?

It’s not a desired behavior, but a limitation for UTC offsets that aren’t in one hour increments and their data store. Here’s a thread where you can read their full response to me (Apple developer account required).


  • How do you test all the time zones without flying all over the world every time you make a change to the app?

The beauty of the code changes that I showed in my presentation is that I wouldn’t have to do that. The app is going to show the time at whatever location it’s going to track and not my local time. Testing time zones in different parts of the world was actually how I spotted how there can be a mismatch in what Apple WeatherKit reports for the start of the day for places such as Nepal.


  • Is there any reason you’d use mismatching timezones for the calendar and format?

Maybe some niche scenario but I can’t seem to find any written explanations as to why you would want to do that.


  • How do you deal when time zone changes for daylight saving time during the period user checks weather for?

I thought about this some more and I think that I answered this one incorrectly on stage. I forgot that I have a timer that pops a little after the top of the hour so that things such as RuleMarks that indicate the current hour will adjust to the new hour. So the Calendar and Date.FormatStyle would adjust properly to the new time zone at that point.


  • Tell us about Apple Watch faces.

I love my Apple Watch except for the watch face situation. The number of analog watch faces (which I hate) drastically outnumber the digital watch faces. And the number of new watch faces added each year is small and the amount that are digital is miniscule. The Apple Watch has been out for over 10 years and I’ve never been able to have a single watch face that I like. What I want would be standard on any other smart watch: horizontal, digital time in the CENTER with some complications above and below it. For some reason Apple has decided that only Apple Watch Ultra users can have this configuration (the Modular Ultra watch face is an example).

modular ultra watch face that has the horizontal time in the center

So as an owner of a series 11 I’m out of luck once again. Completely absurd considering that the Series 11 has an Ultra-sized screen and a nice CPU.

Garmin and Pebble are examples of where I would have too many faces I like to choose from where and with my Apple Watch I have zero.

Garmin
digital watch faces that have the horizontal time in the center

Pebble [Photo from Eric Migicovsky]
digital watch faces that have the horizontal time in the center

I wrote this blog post in 2023 about how unpleasant it can be to use Apple apps/products sometimes if you’re like me and don’t like analog clocks. In an ideal world I’d have a plethora of digital watch faces to choose from either from Apple or a third party watch face store. If we’re not going to get third party watch faces or a lot of digital faces then at the very least please give us some real customization. Putting the (horizontal) time in the middle of my timekeeping device should not be a big ask.

Funny

If you want to watch a man descend into madness because of time zones this is a must watch. Thanks Bas for showing it to me.

Handy Tools

NameDescription
Mercury WeatherMalin and Kai’s weather app.
Fair Weather FriendsTim’s weather app.
Your Calendrical Fallacy Is…If you’re feeling confident that you know a lot about time in general this website from Dave DeLong will humble you quickly.
Gosh Darn Format Style!Handy reference for the date format styles you can use.
everytimezone.comIncredibly useful site to see at a glance what time it is around the world. I use it often for testing when a particular day at a particular location comes to an end.
timeanddate.comAnother handy site with several useful tools. Their time zone converter is so helpful.
World Clock Time Zone WidgetsI started using this app when iOS only had analog clock widgets, which was not that long ago. iOS still doesn’t have a widget for showing multiple time zones with DIGITAL clocks. This app fixes that.

iOS Dev Happy Hour

I’m one of the organizers of iOS Dev Happy Hour, a monthly online meetup that has been running continuously since 2020. We also hold in person events around Cupertino during WWDC. Feel free to join us and meet some great people if you haven’t done so already. We welcome people of all skill levels. If you’re an introvert on the fence about attending I can relate and would be happy to give insight into the event.

We also have a YouTube Channel!

iOS Dev Happy Hour banner

Here’s an example of some of the expert speakers we’ve have. (We also put the spotlight on new devs also.)

CommunityKit

I’m one of the organizers of CommunityKit, a new in-person, three day, FREE event we held in Cupertino during WWDC25. We wanted to help bring the community together through events such as WWDC watch parties, meetups, and our crown jewel - the Indie App Fair. The Indie App Fair let indie developers show their products to the community. And we’re doing it all again in 2026!

CommunityKit banner

Swift Leeds

Big thanks to the Swift Leeds team for giving me this opportunity!

The Swift Leeds stage with a large lighted banner of the name.

Social icons by icons8.