-(void)GetTime:(id)sender
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDateFormatter *formatter =[[NSDateFormatter alloc] init];
NSDate *date = [[NSDate alloc]init];
[formatter setTimeStyle:NSDateFormatterMediumStyle];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss "];//mm
NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];
[formatter setTimeZone:timeZone];
NSString *locationtime = [formatter stringFromDate:date];
currenttime = locationtime;
CurrenttimeLabel.text = currenttime;
CurrenttimeLabel.enabled = NO;
[date release];
[formatter release];
[pool release];
}
- (void)viewDidLoad
{
[NSThread detachNewThreadSelector:@selector(Gettime:)toTarget:selfwithObject:nil];
}