Re: NSDate isEqual to...
Re: NSDate isEqual to...
- Subject: Re: NSDate isEqual to...
- From: Shawn Erickson <email@hidden>
- Date: Fri, 20 Mar 2009 14:07:55 -0700
On Fri, Mar 20, 2009 at 1:50 PM, Charles E. Heizer <email@hidden> wrote:
> Hello,
> I'm playing around with date time stuff right now and I'm trying to figure
> out the bets way to determine if one datetime is equal to another. The
> problem I'm running in to is "isEqualToDate" does not appear to work, the
> NSLog statement will show two identical datetime statements but I never see
> a "These dates are the same!".
What does it mean for one NSDate to be equal to another NSDate from
the point of view of your requirements?
Note what the docs on isEqualToDate: say...
"This method detects sub-second differences between dates. If you want
to compare dates with a less fine granularity, use
timeIntervalSinceDate: to compare the two dates." ...or look at using
-[NSDate laterDate:] -[NSDate earlierDate:]. I generally think in
terms of using the later two methods unless I need to know a specific
delta.
-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