//时间转换
- (NSString*)getTimeWithString:(NSString*)str{
NSString*time =str;
NSDateFormatter*formatter = [[NSDateFormatteralloc]init];
[formattersetDateStyle:NSDateFormatterMediumStyle];
[formattersetTimeStyle:NSDateFormatterShortStyle];
[formattersetDateFormat:@"YYYY-MM-dd HH:mm"];
NSDate*confromTimesp = [NSDatedateWithTimeIntervalSince1970:(NSTimeInterval)[timeintValue]];
NSString*confromTimespStr = [formatterstringFromDate:confromTimesp];
returnconfromTimespStr;
}
网友评论