static NSTimeZone *gmt10 = nil;
static NSTimeZone *gmt11 = nil;
static NSTimeZone *gmt12 = nil;
+static NSTimeZone *gmt0530 = nil;
static NSTimeZone *gmtM01 = nil;
static NSTimeZone *gmtM02 = nil;
static NSTimeZone *gmtM03 = nil;
}
+ (void)initialize {
static BOOL didInit = NO;
+ Class TzClass;
if (didInit) return;
didInit = YES;
CalDateClass = [NSCalendarDate class];
-
+
/* timezones which were actually used in a maillist mailbox */
- gmt = [[NSTimeZone timeZoneWithName:@"GMT"] retain];
- met = [[NSTimeZone timeZoneWithName:@"MET"] retain];
- gmt01 = [[NSTimeZone timeZoneForSecondsFromGMT: 1 * (60 * 60)] retain];
- gmt02 = [[NSTimeZone timeZoneForSecondsFromGMT: 2 * (60 * 60)] retain];
- gmt03 = [[NSTimeZone timeZoneForSecondsFromGMT: 3 * (60 * 60)] retain];
- gmt04 = [[NSTimeZone timeZoneForSecondsFromGMT: 4 * (60 * 60)] retain];
- gmt05 = [[NSTimeZone timeZoneForSecondsFromGMT: 5 * (60 * 60)] retain];
- gmt06 = [[NSTimeZone timeZoneForSecondsFromGMT: 6 * (60 * 60)] retain];
- gmt07 = [[NSTimeZone timeZoneForSecondsFromGMT: 7 * (60 * 60)] retain];
- gmt08 = [[NSTimeZone timeZoneForSecondsFromGMT: 8 * (60 * 60)] retain];
- gmt09 = [[NSTimeZone timeZoneForSecondsFromGMT: 9 * (60 * 60)] retain];
- gmt10 = [[NSTimeZone timeZoneForSecondsFromGMT: 10 * (60 * 60)] retain];
- gmt11 = [[NSTimeZone timeZoneForSecondsFromGMT: 11 * (60 * 60)] retain];
- gmt12 = [[NSTimeZone timeZoneForSecondsFromGMT: 12 * (60 * 60)] retain];
- gmtM01 = [[NSTimeZone timeZoneForSecondsFromGMT: -1 * (60 * 60)] retain];
- gmtM02 = [[NSTimeZone timeZoneForSecondsFromGMT: -2 * (60 * 60)] retain];
- gmtM03 = [[NSTimeZone timeZoneForSecondsFromGMT: -3 * (60 * 60)] retain];
- gmtM04 = [[NSTimeZone timeZoneForSecondsFromGMT: -4 * (60 * 60)] retain];
- gmtM05 = [[NSTimeZone timeZoneForSecondsFromGMT: -5 * (60 * 60)] retain];
- gmtM06 = [[NSTimeZone timeZoneForSecondsFromGMT: -6 * (60 * 60)] retain];
- gmtM07 = [[NSTimeZone timeZoneForSecondsFromGMT: -7 * (60 * 60)] retain];
- gmtM08 = [[NSTimeZone timeZoneForSecondsFromGMT: -8 * (60 * 60)] retain];
- gmtM09 = [[NSTimeZone timeZoneForSecondsFromGMT: -9 * (60 * 60)] retain];
- gmtM10 = [[NSTimeZone timeZoneForSecondsFromGMT:-10 * (60 * 60)] retain];
- gmtM11 = [[NSTimeZone timeZoneForSecondsFromGMT:-11 * (60 * 60)] retain];
- gmtM12 = [[NSTimeZone timeZoneForSecondsFromGMT:-12 * (60 * 60)] retain];
- gmtM13 = [[NSTimeZone timeZoneForSecondsFromGMT:-13 * (60 * 60)] retain];
- gmtM14 = [[NSTimeZone timeZoneForSecondsFromGMT:-14 * (60 * 60)] retain];
+ TzClass = [NSTimeZone class];
+ gmt = [[TzClass timeZoneWithName:@"GMT"] retain];
+ met = [[TzClass timeZoneWithName:@"MET"] retain];
+ gmt01 = [[TzClass timeZoneForSecondsFromGMT: 1 * (60 * 60)] retain];
+ gmt02 = [[TzClass timeZoneForSecondsFromGMT: 2 * (60 * 60)] retain];
+ gmt03 = [[TzClass timeZoneForSecondsFromGMT: 3 * (60 * 60)] retain];
+ gmt04 = [[TzClass timeZoneForSecondsFromGMT: 4 * (60 * 60)] retain];
+ gmt05 = [[TzClass timeZoneForSecondsFromGMT: 5 * (60 * 60)] retain];
+ gmt06 = [[TzClass timeZoneForSecondsFromGMT: 6 * (60 * 60)] retain];
+ gmt07 = [[TzClass timeZoneForSecondsFromGMT: 7 * (60 * 60)] retain];
+ gmt08 = [[TzClass timeZoneForSecondsFromGMT: 8 * (60 * 60)] retain];
+ gmt09 = [[TzClass timeZoneForSecondsFromGMT: 9 * (60 * 60)] retain];
+ gmt10 = [[TzClass timeZoneForSecondsFromGMT: 10 * (60 * 60)] retain];
+ gmt11 = [[TzClass timeZoneForSecondsFromGMT: 11 * (60 * 60)] retain];
+ gmt12 = [[TzClass timeZoneForSecondsFromGMT: 12 * (60 * 60)] retain];
+ gmtM01 = [[TzClass timeZoneForSecondsFromGMT: -1 * (60 * 60)] retain];
+ gmtM02 = [[TzClass timeZoneForSecondsFromGMT: -2 * (60 * 60)] retain];
+ gmtM03 = [[TzClass timeZoneForSecondsFromGMT: -3 * (60 * 60)] retain];
+ gmtM04 = [[TzClass timeZoneForSecondsFromGMT: -4 * (60 * 60)] retain];
+ gmtM05 = [[TzClass timeZoneForSecondsFromGMT: -5 * (60 * 60)] retain];
+ gmtM06 = [[TzClass timeZoneForSecondsFromGMT: -6 * (60 * 60)] retain];
+ gmtM07 = [[TzClass timeZoneForSecondsFromGMT: -7 * (60 * 60)] retain];
+ gmtM08 = [[TzClass timeZoneForSecondsFromGMT: -8 * (60 * 60)] retain];
+ gmtM09 = [[TzClass timeZoneForSecondsFromGMT: -9 * (60 * 60)] retain];
+ gmtM10 = [[TzClass timeZoneForSecondsFromGMT:-10 * (60 * 60)] retain];
+ gmtM11 = [[TzClass timeZoneForSecondsFromGMT:-11 * (60 * 60)] retain];
+ gmtM12 = [[TzClass timeZoneForSecondsFromGMT:-12 * (60 * 60)] retain];
+ gmtM13 = [[TzClass timeZoneForSecondsFromGMT:-13 * (60 * 60)] retain];
+ gmtM14 = [[TzClass timeZoneForSecondsFromGMT:-14 * (60 * 60)] retain];
+
+ gmt0530 = [[TzClass timeZoneForSecondsFromGMT:5 * (60*60) + (30*60)] retain];
}
/*
/*
WARNING: failed to parse RFC822 timezone: '+0530' \
(value='Tue, 13 Jul 2004 21:39:28 +0530')
+ TODO: this is because libFoundation doesn't accept 'GMT+0530' as input.
*/
unsigned char *p = s;
NSTimeZone *tz;
if (p[2] == '4') return gmtM14; // '-1400'
}
}
+
+ /* special case for GMT+0530 */
+ if (strncmp(s, "+0530", 5) == 0)
+ return gmt0530;
}
else if (len == 7) {
/*