Skip to content

Instantly share code, notes, and snippets.

@mattyohe
Created December 6, 2013 15:47
Show Gist options
  • Save mattyohe/7826904 to your computer and use it in GitHub Desktop.
Save mattyohe/7826904 to your computer and use it in GitHub Desktop.
NSDateFormatter fun!
NSTimeInterval time = 1388543400;
NSDateFormatter *formatter = [NSDateFormatter new];
[formatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"EST"]];
[formatter setDateFormat:@"MMMM d, YYYY"];
NSLog(@"%@",[formatter stringFromDate:[NSDate dateWithTimeIntervalSince1970:time]]);
[formatter setDateFormat:@"MMMM d, yyyy"];
NSLog(@"%@",[formatter stringFromDate:[NSDate dateWithTimeIntervalSince1970:time]]);
#### December 31, 2014
#### December 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment