I have a line @ "21:57" and I want to save it in the same HH: mm format in NSDate. I tried to convert it using:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; dateFormatter.dateFormat = @"HH:mm"; NSDate *date = [dateFormatter dateFromString:stringToConvertFrom];
but I get 2000-01-01 21:57:00 +0000 instead of 21:57.
date ios time nsdate
Vinita
source share