Re: Initial values for date fields possible?
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.