• 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: Initial values for date fields possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Initial values for date fields possible?


  • Subject: Re: Initial values for date fields possible?
  • From: Art Isbell <email@hidden>
  • Date: Mon, 15 Dec 2003 10:00:03 -1000

On Dec 15, 2003, at 6:11 AM, Sam Barnum wrote:

// Getting today's date is an easy one:

NSTimestamp searchRangeMax = new NSTimestamp();

// getting one week ago can be done with NSTimestamp.timestampByAddingGregorianUnits(),
// if accuracy isn't crucial (w.r.t daylight savings, etc)


NSTimestamp searchRangeMin = searchRangeMax.timestampByAddingGregorianUnits(0, 0, -7, 0, 0, 0);

Keep in mind that the above will result in a search from the current instant rather than from today's date. The distinction is that users may expect "from" to include everything back to the first instant of today. So you may need to build the "from" timestamp from just the year, month, and day of the current timestamp adjusted for the appropriate timezone.


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.

References: 
 >Re: Initial values for date fields possible? (From: Sam Barnum <email@hidden>)

  • Prev by Date: Re: WORepetition - group by multiples of 10
  • Next by Date: Re: WORepetition - group by multiples of 10
  • Previous by thread: Re: Initial values for date fields possible?
  • Next by thread: WEEK_OF_YEAR Constructor for Gregorian Date?
  • Index(es):
    • Date
    • Thread