mardi 26 mai 2015

Testing for daylight savings time within Cocoa and CocoaTouch

I am developing a calendar application that needs to draw rectangles whose heights and vertical position are based on the start date of the event they represent. I am trying to test the layout system against dates and time zones with daylight savings. Specifically I want to account for the fact that in some regions daylight savings can remove/add an hour to the day.

Currently I'm stumped on how to write unit tests against daylight savings time. I would like to be able to manipulate the device/simulator's time zone at the system level so I can create a reference date on a day when time switches back or forward?

Aucun commentaire:

Enregistrer un commentaire