It is often recommended to have dates formatted to JSON format when communicating with services. A JSON Date format normally looks like this:
To Change a NSDate to JSON Date format, you can do the following:
NSDate *currDate = [NSDate date]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; [dateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSS'Z'"]; NSString *dateString = [dateFormatter stringFromDate:currDate]; NSLog(@"%@",dateString);
The log would show the date in JSON Date format.