标签:
时间戳 -> 时间
NSDate *date = [NSDate dateWithTimeIntervalSince1970:myOrder.orderTimeStart];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MM月dd日 hh:mm"];
NSString *string = [formatter stringFromDate:date];
当前时间 ->时间戳
NSDate *date = [NSDate date];
NSLog(@"%.0f", [date timeIntervalSince1970] * 1000);
日期 ->时间戳
NSDateComponents *comp = [[NSDateComponents alloc] init];
[comp setYear:2016];
[comp setMonth:7];
[comp setDay:13];
NSDate *da = [[NSCalendar currentCalendar] dateFromComponents:comp];
NSTimeInterval time = [da timeIntervalSince1970] * 1000;
标签:
原文地址:http://www.cnblogs.com/lion-witcher/p/5667878.html