+(NSString *)GetFormatTime:(long64)llTime
{
NSDateFormatter *pFormatter = [[NSDateFormatter alloc]init];
long64 time = [[NSDate date]timeIntervalSince1970];
long64 llMissTiming = time-llTime/1000;
NSDate *pDate = [NSDate dateWithTimeIntervalSince1970:(llTime)/1000];
if (llMissTiming >=0 && llMissTiming <= 60*60*24) {
[pFormatter setDateFormat:@"今天 HH:mm"];
}else if (llMissTiming >= 60*60*24 && llMissTiming <=60*60*24*2){
[pFormatter setDateFormat:@"昨天 HH:mm"];
}else if (llMissTiming >= 60*60*24*2 && llMissTiming <= 60*60*24*3){
[pFormatter setDateFormat:@"前天 HH:mm"];
}else if (llMissTiming >= 60*60*24*3 && llMissTiming <= 60*60*24*7)
[pFormatter setDateFormat:@"EE HH:mm"];
else{
[pFormatter setDateFormat:@"yyyy-MM-dd HH:mm"];
}
return [pFormatter stringFromDate:pDate];
}
网友评论