Skip to content

Instantly share code, notes, and snippets.

@modocache
Created February 26, 2014 18:43
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 modocache/9235737 to your computer and use it in GitHub Desktop.
Save modocache/9235737 to your computer and use it in GitHub Desktop.
NSDateFormatter *dateFormatter = [NSDateFormatter new];
dateFormatter.dateFormat = @"yyyy-MM-dd hh:mm:ss";
NSDate *dateOne = [NSDate dateWithTimeIntervalSince1970:1392634252709/1000];
NSDate *dateTwo = [dateFormatter dateFromString:@"2014-02-17 10:50:52"];
// [FAILED], expected subject to equal
// (__NSDate) 2014-02-17 01:50:52 +0000, got
// (__NSDate) 2014-02-17 10:50:52 +0000
[[dateOne should] equal:dateTwo];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment