///获取UTC时间戳
+(NSString *)getNowUTCTimeTimestamp{
NSDate *datenow = [NSDate date];
NSTimeZone *zone = [NSTimeZone localTimeZone];
// 获取指定时间所在时区与UTC时区的间隔秒数
NSInteger seconds = [zone secondsFromGMTForDate:[NSDate date]];
NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)[datenow timeIntervalSince1970] - seconds];
return timeSp;
}
网友评论