Anyone know what the minimum and maximum possible values are for an NSDate?
maximum should be: 5828963-12-20 00:00:00 +0000 because
NSDate *dateSinceNow = [NSDate dateWithTimeIntervalSinceNow:DBL_MAX];
NSDate *dateSindeReferenceDate = [NSDate dateWithTimeIntervalSinceReferenceDate:DBL_MAX];
NSLog(@"min: %@, max: %@", dateSinceNow, dateSindeReferenceDate);
is the same.
minimum i get this is: 0001-01-01 00:00:00 +0000
cause this is what i get when i try:
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"yyyy-MM-dd hh:mm:ss"];
[df setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
NSDate *myDate = [df dateFromString: @"0001-01-01 00:00:00"];
NSLog(@"%@", myDate);
but this is current era as pointed out by davedelong
so if you try the first example with - DBL_MAX you get: 41221-07--2147483641 00:00:00 +0000. no idea what era this is...