• 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
NSDate isEqual to...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDate isEqual to...


  • Subject: NSDate isEqual to...
  • From: "Charles E. Heizer" <email@hidden>
  • Date: Fri, 20 Mar 2009 13:50:06 -0700

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!".


Can someone please tell me how I can get this to work.

Thanks,
Charles

NSDate *theDateTimeToRunAt = [NSDate dateWithString:@"2009-03-20 13:18:00 -0700"];
NSDate *theCurrentDateTime = [NSDate date];
while(1)
{
NSLog(@"theDateTime1=%@ | theCurrentDate=%@", theDateTimeToRunAt, theCurrentDateTime);
if ([theDateTime1 isEqualToDate:theCurrentDate]) {
NSLog(@"These dates are the same!");
[theDateTimeToRunAt addTimeInterval:900]; // Add 15 Minutes to say hi again!
}

sleep(1);
theDate = [NSDate date];
}
_______________________________________________


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


  • Follow-Ups:
    • Re: NSDate isEqual to...
      • From: Shawn Erickson <email@hidden>
    • Re: NSDate isEqual to...
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Re: NSData confusion
  • Next by Date: Re: NSDate isEqual to...
  • Previous by thread: Re: q's regarding appropriate use of core data?
  • Next by thread: Re: NSDate isEqual to...
  • Index(es):
    • Date
    • Thread