NSDate isEqual to...
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