Re: filterArrayWithQualifier: how do i set a fetch for timestamp for one day?
Re: filterArrayWithQualifier: how do i set a fetch for timestamp for one day?
- Subject: Re: filterArrayWithQualifier: how do i set a fetch for timestamp for one day?
- From: Art Isbell <email@hidden>
- Date: Thu, 5 Jun 2003 16:53:11 -1000
On Thursday, June 5, 2003, at 09:59 AM, email@hidden wrote:
i am developing a web-application with messages in an openbase
database.
these messages have a NSTimestamp value with the time it was written.
i want to make a search on these messages and with text-search it
worked.
how can i filter objects that are written on one day?
i tried to use:
searchdate = new NSTimestamp(ayear, amonth, aday, 0, 0, 0, atimezone);
qualsearch = EOQualifier.qualifierWithQualifierFormat ("timestamp = '"+
searchdate()+"'", null);
EOQualifier.filterArrayWithQualifier(messageList, qualsearch);
The above should work if your timestamps are precise to no less than a
day; i.e., the hours, minutes, seconds, milliseconds are 0.
But if your timestamps are precise to the millisecond, then you'd need
to use a qualifier for a timestamp range.
searchdateStart = new NSTimestamp(ayear, amonth, aday, 0, 0, 0,
atimezone);
searchdateEnd = searchdateStart.timestampByAddingGregorianUnits(0, 0,
1, 0, 0, 0);
qualsearch = EOQualifier.qualifierWithQualifierFormat ("timestamp >= %@
and timestamp < %@", new NSArray(new NSTimestamp[] {searchdateStart,
searchdateEnd}));
Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.