I have one date on NSString
with format: "Jun 25, 2014 10:10:15 AM"
I need to put this date from one NSDate
. But I tried some formats on date format and always value of NSDate
is nil on device. If I run by Xcode on device or on simulator its work but i generate a .ipa and send to iPhone not work.
code:
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"MMM dd, yyyy HH:mm:ss a"];
NSDate * dataStringFormatted = [dateFormat dateFromString: @"Jun 25, 2014 10:10:15 AM"];
I tried formats:
@"MMM dd, yyyy HH:mm:ss a"
@"MMM dd, yyyy H:mm:ss a"
@"MMM dd, yyyy HH:mm:ss aa"
@"MMM dd, yyyy H:mm:ss aa"
@"MMM dd, yyyy HH:mm:ss aaa"
@"MMM dd, yyyy H:mm:ss aaa"
@"MMMM dd, yyyy H:mm:ss aa"
@"MMMM dd, yyyy H:mm:ss aaa"
@"MMMM dd, yyyy H:mm:ss a"
@"MMM dd, yyyy HH:mm:ss A"
With all formats always the Object NSDate
is nil.
Thank.