Frage

I'm working on an app that can book services in later dates in many timezones. My problem is that when i'm getting timezone for one country, i got this timezone for now.

But this week-end we will change our timezone, and Paris (Actually +1) we'll become +2.

How can I get this timezone for a date like tuesday programmatically ?

War es hilfreich?

Lösung

You can use various methods. One would be to use

- (NSInteger)secondsFromGMTForDate:(NSDate *)aDate

of NSTimeZone and get the GMT offset for a certain date and a certain timezone. Or you can use

– daylightSavingTimeOffsetForDate:

to check wether there needs a DST offset to be accounted for.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top