Re: DT_DATE_TIME_DURATION usage

Berend de Boer <[email protected]> Thu, 29 May 2008 08:19:45 +1200
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
>>>>> "Eric" == Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]> writes:

    Eric> There is nothing readily available. Let's consider that you
    Eric> have a duration of 1 month, and you want to quarter of
    Eric> it. What should it be? Well, I guess it depends on what you
    Eric> want to do with that duration. If it's to be added to a date,
    Eric> then the result depends on that date. In that case I would
    Eric> suggest turning the duration into a definite duration (using
    Eric> `to_definite'). Then turn it into a number of milliseconds
    Eric> (days * milliseconds_in_days + millisecond_count). Then you
    Eric> can divide by 4 and create a new date-time-duration using
    Eric> `make_precise_canonical_definite'.

That should work yeah. I'll try that.

Would it be a good idea to add '*' and '/' operators to this class? They
would take a number as argument and return a new duration.

-- 
Cheers,

Berend de Boer


[Non-text portions of this message have been removed]