본문 바로가기
프로그램/iOS

iOS second Data 변형

by 고래밥89 2016. 3. 15.
반응형
int64_t time = [[SecondData] longLongValue];

NSTimeInterval timeInterval = (time/1000);
 NSDate *theDate = [[NSDate alloc]initWithTimeIntervalSince1970: timeInterval];
 NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
 [dateFormat setLocale:[NSLocale currentLocale]];
 [dateFormat setDateFormat:@"HH:mm"];    //받고싶은 형태
   
 NSString *time2 = [dateFormat stringFromDate:theDate];
반응형