我正在做objective-c(iOS)开发。我可以知道如何将 GMT +0 的默认时区更改为 GMT +8。GMT +8 适用于新加坡。
这是我的代码:
- (IBAction)dateChanged {
NSDate *choice = [datePick date];
NSString *words = [NSString alloc initWithFormat:@"%@", choice];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"You have selected:" message:words delegate:nil cancelButoonTitle:@"OK" otherBUttonTitles:nil, nil];
[alert show];
[alert release];
[words release];
}
谢谢。