iSara iSara - 1 year ago 90
Objective-C Question

How to set UIDatePicker's date's seconds value to 00?

How to always get seconds value "

" for
's date?

Now I am getting value like this format
, I need to get this format of time

How to achieve this?

Answer Source
NSDate *currentDate = [datePicker date];    
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"ss"];
[dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0.0]];
NSString *Str_Seccond=[dateFormatter stringFromDate:currentDate];

In Str_Seccond string you can get the seconds in string format.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download