I have app where i need to get the current time (CST). I'm trying to use the following code but the NDate is the same as GMT:
NSDate* date = [NSDate date];
NSLog(@"Time is %@", [date description]);
[NSTimeZone setDefaultTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"CST"]];
NSDate* nDate = [NSDate date];
NSLog(@"Central time is%@", [nDate description])
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…