Skip to content

Instantly share code, notes, and snippets.

@sonsongithub
Created September 4, 2012 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sonsongithub/3615998 to your computer and use it in GitHub Desktop.
Save sonsongithub/3615998 to your computer and use it in GitHub Desktop.
Is this bug...?
NSString *input = @"Sun Mar 18 06:42:26 +0000 2007";
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"EEE MMM dd HH:mm:ss Z yyyy"];
[formatter setLocale:[NSLocale systemLocale]];
NSDate *date = [formatter dateFromString:input];
NSLog(@"String = %@", input);
NSLog(@"Date = %@", date);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment