in reply to Fractional times in Date::Calc

I must say I sympathise with the module here. The idea of the "fractional hour" is an inherently ambiguous one and would certainly lead to problems for someone, somewhere in the future. I'd say it's to their credit that it handles it gracefully by making the 1.1 into a 1.

I think your solution is the right way -- pre-process ambiguous information into a form that is acceptable to the module.



($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss') =~y~b-v~a-z~s; print

Replies are listed 'Best First'.
Re: Re: Fractional times in Date::Calc
by thor (Priest) on Aug 13, 2003 at 05:10 UTC
    I don't see how a fractional hour is ambiguous. Would there be a different way to interpret "1.25 hours" other than "1 hour and 15 minutes"? The only other way I could see interpreting that string would be to have it mean "1 hour and 25 minutes", that that's what 1:25 is for...:)

    thor

    Update: Corrected last sentence so that it actually makes sense

      Would there be a different way to interpret "1.25 hours" other than "1 hour and 15 minutes"?

      Well obviously, one hour and twenty-five minutes.

      You've got a system which is not decimal-based, and you're using it with decimals.



      ($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss') =~y~b-v~a-z~s; print