How to find out the current timezone offset on the device in HOURS ?
NSDate *sourceDate = [NSDate dateWithTimeIntervalSinceNow:3600 * 24 * 60];
NSTimeZone* destinationTimeZone = [NSTimeZone systemTimeZone];
float timeZoneOffset = [destinationTimeZone secondsFromGMTForDate:sourceDate] / 3600.0;
NSLog(@"sourceDate=%@ timeZoneOffset=%d", sourceDate, timeZoneOffset);
Don't use an int!!! I copied this code and now have a bug in my app. Some timezones are .5 hrs
use this:
float offset = [timezone secondsFromGMTForDate:self.date] / 3600.0;
and don't forget the .0 behind 3600