• 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: Best approach to handling times
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Best approach to handling times (From: Ray Ackland <email@hidden>)

  • Prev by Date: Re: Using NSArray functions in WO
  • Next by Date: Re: EOModeler JDBC connection help in Windows
  • Previous by thread: Best approach to handling times
  • Next by thread: Using NSArray functions in WO
  • Index(es):
    • Date
    • Thread