I am using NSDateFormatter to convert a string date to a NSDate.
This works.
NSDateFormatter * formatDate = [[NSDateFormatter alloc] init];
[formatDate setDateFormat:@"ddMMMyyyy hh:mm:ss a zzz"];
dateStr = @"01Jul2019 08:15:00 PM EDT";
tempInv.time_of_purchase = [formatDate dateFromString:dateStr];
This does not work and returns nil ???
NSDateFormatter * formatDate = [[NSDateFormatter alloc] init];
[formatDate setDateFormat:@"ddMMMyyyy hh:mm:ss a zzz"];
dateStr = @"01Jul2019 08:15:00 PM IST";
tempInv.time_of_purchase = [formatDate dateFromString:dateStr];
only difference is the TIME ZONE. In the 2nd one its IDT. note: it seems PST works fine. EST works fine. but others do not.
can anyone shed some light on this ? and why nil would be getting returned. note: the iphone it is running on is EDT.