Guest User

Untitled

a guest
Oct 21st, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. //example convert time to string
  2. NSDateFormatter *inputDateFormatter2 = [[NSDateFormatter alloc]init];
  3. [inputDateFormatter2 setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
  4. NSDateFormatter *inputDateFormatter3 = [[NSDateFormatter alloc]init];
  5. [inputDateFormatter3 setDateFormat:@"yyyy/MM/dd"];
  6. //"work_time6" = "2017-10-20 17:43:42";
  7. NSDate *date = [inputDateFormatter2 dateFromString:aKarte[@"update_date"]];
  8. NSString *dateString = @"";
  9. if (date) {
  10. dateString = [inputDateFormatter3 stringFromDate:date];
  11. }
Add Comment
Please, Sign In to add comment