iphone - Why can't I correctly parse this date string with NSDateFormatter? -
I am trying to parse a string that is generated by using an NSDateFormatter with the same format using the other NSDateFormatter I went.
Instead of trying to make that last sentence, there is some code:
NSDateFormatter * format = [[NSDateFormatter alloc] init]; [Format setDateFormat: @ "MMM DD, YYYH H: MM"]; NSDT * now = [[NSDT allok] Init]; NSString * dateString = [format string format: now]; NSDateFormatter * inFormat = [[NSDateFormatter alloc] init]; [Informatetet format: @ "MMM DD, YYYH H: MM"]; NSDT * Parsed = [Format date formatting: datestring]; NSLog (@ "\ n" "Now: |% @ | \ n" "Date String: |% @ | \ n" "Parsed: |% @ |", Now, Dest String, Parsed); When I run this code, I hope that is parsed will have the same date as now but instead of me The following output is available:
YYYY "Formatting a valid ICU date There is no option you want "yyyy".
Capital 'Y' is valid only when used with the "Week of the year" option (i.e. "Weiq" '' V '')
Comments
Post a Comment