Re: NSDate isEqual to...
Re: NSDate isEqual to...
- Subject: Re: NSDate isEqual to...
- From: Shawn Erickson <email@hidden>
- Date: Fri, 20 Mar 2009 16:08:02 -0700
On Fri, Mar 20, 2009 at 2:17 PM, Charles E. Heizer <email@hidden> 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?
You could add a category (say isEqualToDateUsingSecondResolution:) to
do that with code like the following...
if (fabs([someDate timeIntervalSinceDate:someOtherDate]) < 1.0) {
// equal ignoring sub-second resolution
}
-Shawn
_______________________________________________
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