NSDateFormatter * formatter = [[NSDateFormatter alloc]init];
[formatter setDateFormat:@"yyyy-MM-dd-hh:mm:ss"];
formatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"];
NSDate * date = [NSDate date];
NSString * timeNow = [formatter stringFromDate:date];
NSLog(@"timeNow %@", timeNow);//2016-03-22-01:23:39
//格林威治时间 秒10位 1458624241
UInt64 recordTime0 = [[NSDate date] timeIntervalSince1970];
//格林威治时间 毫秒13位 1458624284282
UInt64 recordTime = [[NSDate date] timeIntervalSince1970]*1000;
//格林威治时间,晚8个小时 2016-03-22 05:26:22 +0000
NSDate * date22 = [NSDate date];
NSLog(@"date22 %@",date22); //格林威治时间,晚8个小时
//中国时间毫秒 1458653287948 13位
UInt64 time = ([[NSDate date] timeIntervalSince1970]+28800)*1000;
NSLog(@"time %llu", time);
//精确到小数点后6位 1458653335251.256836
double recordTime13 = ([[NSDate date] timeIntervalSince1970]+28800)*1000.0;
NSLog(@"recordTime13 %f", recordTime13);
//毫秒转日期 2016-03-22 13:28:07 +0000
NSDate *d = [[NSDate alloc]initWithTimeIntervalSince1970: time/1000
];
NSLog(@"d %@", d);//2016-03-22 13:19:32 +0000