I have 2 NSString say startTime and endTime.
startTime = 10:00 AM
endTime = 7:00 PM
Now i want to split the time in the interval of 30mins, so i can get time like this:
10:00 AM
10:30 AM
11:00 AM
11:30 AM
………. till 7:00 PM.
i’m trying something like this :
NSDateFormatter *timeFormat = [[NSDateFormatter alloc] init];
[timeFormat setDateFormat:@"HH:mm"];
NSDate* fromTime = [timeFormat dateFromString:startTime];
NSDate* toTime = [timeFormat dateFromString:endTime];
But i’m getting the from fromTime = 1970-01-01 6:00:00 +0000 for the value of startTime = 11:30
Anybody has any idea,how to do it???
Try the above code.