• 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
Re: Fetching By Date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Fetching By Date (From: Jonathan Miller <email@hidden>)

  • Prev by Date: Re: Default values in EOF
  • Next by Date: Re: Tiger, Xcode 2, Java 1.5!
  • Previous by thread: Fetching By Date
  • Next by thread: Fetching By Date
  • Index(es):
    • Date
    • Thread