I want current time in following format in a string.
dd-mm-yyyy HH:MM
How?
You want a date formatter. Here's an example:
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"dd-MM-yyyy HH:mm"]; NSDate *currentDate = [NSDate date]; NSString *dateString = [formatter stringFromDate:currentDate];
1.4m articles
1.4m replys
5 comments
57.0k users