NSDate *date = [NSDate date];
NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components:NSDayCalendarUnit fromDate:date];
NSInteger _day=[dateComponents day];
dateComponents = [[NSCalendar currentCalendar] components:NSMonthCalendarUnit fromDate:date];
NSInteger _month=[dateComponents month];
Similarly, you can get the other components like year, hour, seconds etc , you will have to change components: to relevant CalendarUnit and you can access them with [dateComponents year], [dateComponents hour] etc.
ReplyDeletenice blogs.
Friend chatMake new friend’s without revealing yourself. Dial 543216 at Rs 2/min and monthly subscription of Rs 30/ 30 days.