2 NSDates that should be equal aren't?
I'm using the JSON library from Stig Brautaset(http://code.google.com/p/json-framework) and I need to serialize an NSDate. I was considering converting it into a string before JSONifying it, however, I ran into this weird behavior: Why aren't these NSDates considered equal? NSDate *d = [[NSDate alloc] init]; NSDate *dd = [NSDate dateWithString:[d description]]; NSLog(@"%@", d); NSLog(@"%@", dd); if( [d isEqualToDate:dd] ){ NSLog(@"Yay!"); } When you describe the original date object you lose some sub-second precision from the original object — in other words, -description shaves off fractional