Re: NSDate isEqual to...
Re: NSDate isEqual to...
- Subject: Re: NSDate isEqual to...
- From: Mike Abdullah <email@hidden>
- Date: Fri, 20 Mar 2009 21:50:05 +0000
On 20 Mar 2009, at 21:17, Charles E. Heizer wrote:
Thanks,
No it's just playing around right now. It would be nice to be able
to specify if you wanted NSDate to be sub-second or second precision
based.
Just as question, can NSDate be overridden to be second precision
based?
Theoretically yes. Practically, it would be a rather bad idea. 1
second is meaningful to you, but consider a completely different
culture's calendaring system where "a second" is actually equivalent
to 3 of ours seconds. What would second precision be then?
The point is that you don't really want to test the equality of two
dates. Instead you want to compare them like so:
date1 >= date2
date1 <= date2
Or you want to know if they're roughly equal to each other. "Is date1
within 0.5 seconds of date2"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden