Re: New class tools::Duration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Monday, 2023-06-19 18:41:48 +0200, Eike Rathke wrote:
> On Monday, 2023-06-19 14:25:16 +0200, Eike Rathke wrote:
> >     friend tools::Duration operator -( const DateTime& rDateTime1, const DateTime& rDateTime2 );
> > (you can also use that temporarily to find code places to change).
> 
> Having tried that, it tends to get cumbersome [...]

So what I came up with is

    static  double  Sub( const DateTime& rDateTime1, const DateTime& rDateTime2 );

and changed all relevant places to use DateTime::Sub() instead of
operator-(), which were less than I initially thought there would be.

Next step will change operator-() to

    friend tools::Duration operator -( const DateTime& rDateTime1, const DateTime& rDateTime2 );

so if one needs a duration to be remembered use that, and otherwise if
the floating point "time in days" value is to be processed use
DateTime::Sub().

  Eike

-- 
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux