// 时间戮转时间
- (NSString *)timeToStr:(NSString *) str {
NSTimeInterval interval=[[NSString nullToString:str] doubleValue] ;
NSDate *date = [NSDate dateWithTimeIntervalSince1970:interval];
NSDateFormatter *objDateformat = [[NSDateFormatter alloc] init];
NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/BeiJing"];
[objDateformat setTimeZone:timeZone];
[objDateformat setDateFormat:@"yyyy-MM-dd"];
NSString * timeStr = [NSString stringWithFormat:@"%@",[objDateformat stringFromDate: date]];
return timeStr;
}
网友评论