Re: datetime:diff() question

new topic     » goto parent     » topic index » view thread      » older message » newer message
Ekhnat0n said...

The problem is that jesse's vars dt1 and dt2 bear the same name as the arguments INSIDE the function diff(arg1, arg2), however, and if they had been named start and stop no misunderstanding would have risen.
If you are asked if val1 is lower or higher than val2, you will answer heigher in the case of TS.
Indicating a positive difference between them, but in order to achieve that, diff() must calculate arg2-arg1
to show that the 2nd is highest.
The scope of dt1 and dt2 inside diff() is limited to the function, and that's causing the problem for this particular case.

I am not concerned with what is "inside" the function. I want the answer to be as predicted by the documentation. As to scope, my variables are totally unrelated to those inside the function. Having the same name was a chance occurrence. In my universe the meaning of the statement "subtract 1 from 2 means: ans = 2 - 1. Start, Stop, Beginning, End, etc. have no meaning and time's arrow does flow only in one direction (to the right in my universe); however, if one number is bigger than another only one answer for the difference is possible!

regards, jd

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu