希望大家相互学习 多多分享
//时间戳转化为日期
-(NSString *)UTCchangeDate:(NSString *)utc{
NSTimeInterval time = [utc doubleValue];
NSDate *date=[NSDate dateWithTimeIntervalSince1970:time];
NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];
[dateformatter setDateFormat:@"MM.dd HH:mm"];
NSString *staartstr=[dateformatter stringFromDate:date];
return staartstr;
}
//日期转化为时间戳
-(NSString *)dataChangeUTC:( NSDate*)date{
NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)[date timeIntervalSince1970]];
return timeSp;
}
网友评论