I have time portion as a string and I want to parse it into date, as I have concern about the time portion of date. But when I parse it with the given format, result is nil. How should I parse my Time String?
Time String: 23:59
Method:
+(NSDate*)getDateFromStringProfile:(NSString*)strDate
{
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
NSTimeZone *timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0];
[dateFormat setDateFormat:@"HH:mm"];
[dateFormat setTimeZone:timeZone];
NSDate *result =[dateFormat dateFromString:strDate];
return result;
}
Result: nil