18 时间戳

2016-09-14  本文已影响0人  _Nevermore

//获取当前时间戳
- (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;
}

上一篇下一篇

猜你喜欢

热点阅读