Saying "today" in predicates, or, "in the last"
Saying "today" in predicates, or, "in the last"
- Subject: Saying "today" in predicates, or, "in the last"
- From: Francisco Tolmasky <email@hidden>
- Date: Fri, 14 Oct 2005 04:09:49 -0700
I'm using predicates in my program and I'd like to know if there is a
way to say "today" without physically inserting todays date every
time I want to use the predicate, as so:
[NSPredicate predicateWithFormat: @"date == %@", [NSDate date]]
I know you can also have predicate with replacement values, but
again, every time I want to use the predicate I'd have to inform it
of the new date. Is there any way to just say [NSPredicate
predicateWithFormat: @"date == today"]?
The reason I want to know this is because I want to implement "in the
last 5 days" or such a predicate, where a date would basically have a
value added then compared against the current date, as so:
@"date+xdaysorwhatever <= today"
So if there is simply a better way of expression "in the last X
whatevers" that would help also.
Thank you in advance,
Francisco Tolmasky
email@hidden
www-scf.usc.edu/~tolmasky
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden