Guest User

Untitled

a guest
Jul 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. NSDateFormatter *timeOfArrival = [[NSDateFormatter alloc] init];
  2. [timeOfArrival setTimeStyle:NSDateFormatterLongStyle];
  3. [timeOfArrival setDateStyle:NSDateFormatterNoStyle];
  4. [timeOfArrival setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease]];
  5.  
  6. NSString *etaStr = [attributeDict objectForKey:@"cumulativeTime"];
  7. NSLog(@"%@", etaStr);
  8. checkpoint.eta = [timeOfArrival dateFromString:etaStr];
  9.  
  10. NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
  11. [formatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease]];
  12. [formatter setDateFormat:@"HH:mm:ss"];
  13. NSString *etaStr = @"00:14:00";
  14. NSLog(@"%@", [formatter stringFromDate:[formatter dateFromString:etaStr]]);
  15. [formatter release];
  16.  
  17. 00:14:00
Add Comment
Please, Sign In to add comment