• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSDate isEqual to...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSDate isEqual to... (From: "Charles E. Heizer" <email@hidden>)

  • Prev by Date: Re: NSDate isEqual to...
  • Next by Date: Re: [noob] Best practice for creating multiple instances of a View
  • Previous by thread: Re: NSDate isEqual to...
  • Next by thread: Customization of NSSavePanel
  • Index(es):
    • Date
    • Thread