服务器返回的时间戳
- (NSString*)getOvertime:(NSString*)mStr{
NSTimeInterval interval =[mStr doubleValue] / 1000.0;
NSDate *date = [NSDate dateWithTimeIntervalSince1970:interval];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"HH:mm"];
NSString *dateString = [formatter stringFromDate: date];
NSLog(@"服务器返回的时间戳对应的时间是:%@",dateString);
return dateString;
}
网友评论