Anyone know how to set the time zone in an NSDate object prior to iOS 4.0? In iOS 4 and greater I do the following:
NSCalendar *calendar = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease];
NSDateComponents *components = [calendar components:(NSYearCalendarUnit|NSMonthCalendarUnit|NSWeekdayCalendarUnit|NSDayCalendarUnit|NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit|NSTimeZoneCalendarUnit) fromDate:aDate];
NSTimeZone *gmt = [NSTimeZone timeZoneForSecondsFromGMT:0];
[components setTimeZone:gmt];
NSDate *newDate = [calendar dateFromComponents:components];
Problem is, setTimeZone and NSTimeZoneCalendarUnit are only available starting with iOS 4.0. Will I have to do a subtraction on the hours component?