标签:
//时间格式
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MMM dd,yyyy HH:mm tt"];
//时间字符串NSDate
NSDate *date = [formatter dateFromString:string];
//NSDate转时间字符串
NSString *dateString = [formatter stringFromDate:date];
//时间转时间戳
NSTimeInterval interval = [date timeIntervalSince1970];
//时间戳转时间
date = [NSDate dateWithTimeIntervalSince1970:interval];
NSDate NSString时间字符串 NSTimeInterval 的转换
标签:
原文地址:http://www.cnblogs.com/siasyl/p/5162410.html