Converting NSDate To NSString With NSDateFormatter...
NSDate *date = [[NSDate alloc] init];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"dd-MM-YYYY HH:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:date];
NSLog(@"The Date: %@", dateString);
We can setDateFormate as we like example..
HH:mm a, dd-MMMM-YYYY like this try different ways....!
No comments:
Post a Comment