Re: Best approach to handling times
Re: Best approach to handling times
- Subject: Re: Best approach to handling times
- From: Chuck Hill <email@hidden>
- Date: Thu, 11 Sep 2003 07:50:39 -0700
NSTimestamp is implemented in terms of milliseconds, so I'd use that
instead of seconds. No changes should be needed on that account.
In terms of using KVC (the @sum function etc.), take a look at the docs for
NSArray, NSArray.Operator, and the NSArray method
public static void setOperatorForKey(String operatorName,
NSArray.Operator arrayOperator)
You should be able to derive and register your own sub-class of
NSArray.Operator that calculates total time (e.g. @totalTime).
HTH
Chuck
At 08:06 PM 11/09/2003 +1200, Ray Ackland wrote:
>My current project has a class with a number of time fields. Along with
>the raw data, I am wanting to have some summary fields (eg total time).
>
>I can think of a couple of alternatives for doing this -
> storing them as NSTimestamp and then converting to seconds before
>adding them (summing date/time stamps doesn't seem to make much sense);
> storing the originals as seconds and converting them to NSTimestamp
>for display. Hassle having to do all the extra coding though.
>
>Can anybody suggest which is the best way of handling them? Would be
>nice to use the @sum functions, so the second option sounds more
>workable.
>
>thanks,
>
>Ray.
>_______________________________________________
>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.
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
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.