Re: Fetching By Date
Re: Fetching By Date
- Subject: Re: Fetching By Date
- From: Art Isbell <email@hidden>
- Date: Fri, 29 Apr 2005 08:32:53 -1000
On Apr 29, 2005, at 7:37 AM, Jonathan Miller wrote:
I was wondering what is the best approach to searching the Database
by a date. For example suppose I want to find all articles in a
given month. Is it possible to accomplish this by using a
combination of EOQualifier and an NSTimestamp?
For example, to search for all articles whose "publishingDate"
is within March, 2005, create a "startTimestamp" NSTimestamp whose
value is 2005/03/01 00:00:00 and an "endTimestamp" NSTimestamp whose
value is 2005/04/01 00:00:00. Then create an "AND" qualifier:
publishingDate >= startTimestamp and publishingDate < endTimestamp.
Beware that NSTimestamps do not include time zone info, so the
timestamps will be in GMT. So you might want to offset these
timestamps for a particular time zone that makes more sense for your
app.
Aloha,
Art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden