프로그램/iOS

iOS second Data 변형

잡식성초보 2016. 3. 15. 13:45
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];
반응형