On Jan 2, 2008, at 12:01 PM, David Avendasora wrote:

Hi all,

I am working on some date-related calculations for a report. On the report the user specifies a date, and I want to match to a NSTimestamp-typed attribute in my Entity. The problem is that, of course, the attribute also contains time information which for this report is meaningless.

I've come up with a couple ways to achieve what I'm trying to do, and they seem to work, but they feel _very_ clunky and overly difficult, which brings me back to the old WO axiom: if it's hard, you're probably not doing it the WO-way.

That is a mis-quote. The actual axiom is "if it's hard, you're probably not doing it the WO-way unless you are working with dates". :-)


So, what are the best practices for working with an NSTimestamp field, when all you really want is the date, not the time?


There isn't any that I am aware of. I usually "normalize" these to noon in the setXXXDate() methods.

Chuck


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to