Question

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 ?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top