Ghass.64 Ghass.64 - 1 year ago 87
Objective-C Question

How to get the date without Time from NSDate?

I want to get the date from

and do not need time. Example:

NSDate* today = [NSDate date]; // want to give 20-06-2012 only

I want to get the date for today without showing the time and use it in
variable or string variable.

Answer Source

In case someone else looks for this. I used the following:

NSDateComponents *components = [[NSCalendar currentCalendar] 
              fromDate:[NSDate date]];
NSDate *startDate = [[NSCalendar currentCalendar] 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download