• 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: Date-Only NSTimestamps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date-Only NSTimestamps


  • Subject: Re: Date-Only NSTimestamps
  • From: Art Isbell <email@hidden>
  • Date: Wed, 2 Jan 2008 12:47:18 -1000

On Jan 2, 2008, at 11:25 AM, Pierce T. Wetter III wrote:

I'm A bit of a date/time wonk

I was also until the choice became one of continuing to be a date/ time wonk or descending further into insanity (or maybe "ascending" would be more appropriate :-)


In your case, you're doing a report, so you have 2 date ranges. So this then becomes a UI question. Let's say someone wants to do a query for 2007. In most reporting software, that becomes:

WHERE date >= TIMESTAMP '2007-01-01 00:00:00' and date < TIMESTAMP '2008-01-01 00:00:00'

that is, to get all of 2007, you really have to put the end date in as midnight of the first second of 2008.

Definitely!

Which is weird UI, because the dates themselves are:

2007-01-01 to 2007-12-31

I try to finesse this by using "2007-01-01 through 2007-12-31", but most users don't seem to grok the distinction.


So.... What you can do is basically tweak the inputs. The low date is rounded _down_ to midnight, the high date is converted to the _next_ day then rounded down.

where date >= input_low.beginningOfDay() and date < input_high.nextDay().beginningOfDay()

Yep. This is what we date/time wonks know is the only correct way :-)

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: 
 >Date-Only NSTimestamps (From: David Avendasora <email@hidden>)
 >Re: Date-Only NSTimestamps (From: "Pierce T. Wetter III" <email@hidden>)

  • Prev by Date: RE: Progress bars and HTML generation
  • Next by Date: Re: Progress bars and HTML generation
  • Previous by thread: Re: Date-Only NSTimestamps
  • Next by thread: Marketplace Survey results
  • Index(es):
    • Date
    • Thread