Created
April 9, 2014 16:41
-
-
Save Garfeild/10290336 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | |
[dateFormatter setTimeStyle:NSDateFormatterFullStyle]; | |
[dateFormatter setDateStyle:NSDateFormatterFullStyle]; | |
NSDate *date1 = [NSDate dateWithTimeIntervalSinceNow:0]; | |
NSDate *date2 = nil; | |
NSString *string = [dateFormatter stringFromDate:date1]; | |
date2 = [dateFormatter dateFromString:string]; | |
// [date1 isEqualToDate:date2] will return NO. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment