Skip to content

Instantly share code, notes, and snippets.

@caiguo37
Created August 8, 2013 06:27
Show Gist options
  • Save caiguo37/6181962 to your computer and use it in GitHub Desktop.
Save caiguo37/6181962 to your computer and use it in GitHub Desktop.
parse http header date
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]];
dateFormatter.dateFormat = @"EEE, dd MMM yyyy HH:mm:ss zzz";
NSDate *date = [dateFormatter dateFromString:dateString];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment