#date & time

3 posts with this tag

Keeping dates local

December 11, 2018

In our day-to-day life, dates are pretty straight forward - we read them all the time, make plans around them, and share them with other people. Apart from the occasional missed birthday party all of these date-based tasks go surprisingly smoothly. Which is remarkable when you stop to think how complex our date systems are. It works this smoothly because everyone is making some pretty large, unspoken assumptions around the dates that they see - what calendar is used, what timezone is used, the ordering of d…

Sneaky date formatters exposing more than you think

October 29, 2018

Ask any iOS developer about DateFormatter and one of the first things you will hear is that creating a DateFormatter instance is an expensive operation. The second thing you will hear is that after creating one you need to cache it. In this post, I want to look at how expensive it is to create DateFormatter instances and how we can cache them effectively. To determine just how expensive they are we will need to conduct a small experiment 🔬. If you'd prefer not to have to manually build up the below exam…