How do I get the current time and format it to ISO 8601?
By these I mean the format: YYYY-MM-DDTHH:MM:SSZ where T and Z are not time represented; they are constants.
How do I get the current time and format it to ISO 8601?
By these I mean the format: YYYY-MM-DDTHH:MM:SSZ where T and Z are not time represented; they are constants.
The way to achieve this is by:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm'Z'"];
NSDate *date = [NSDate date];
NSLog(@"%@",[dateFormatter stringFromDate:date]);