18 时间戳

//获取当前时间戳
- (NSString*)getCurrentTime {
NSDate datenow = [NSDate date];
NSTimeZone
zone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"];
NSInteger interval = [zone secondsFromGMTForDate:datenow];
NSDate *localeDate = [datenow dateByAddingTimeInterval:interval];
NSString *timeSpp = [NSString stringWithFormat:@"%f", [localeDate timeIntervalSince1970]];
return timeSpp;
}

你可能感兴趣的:(18 时间戳)