Re: datetime:diff() question

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

arguments are described as:

diff( end_time, start_time )

  • documentation says calculation is: end_time - start_time
  • source-code says calculation is: start_time - end_time

Something is backwards.

At the moment the documentation is wrong because it has to describe the source-code.


The question is now: what is the expected order of arguments in the diff function?

for those that believe that time moves in one direction only

  • One could easily argue that diff( start_time, end_time ) makes sense; the return should be positive since you "expect" end_time to come after start_time.

for those just doing arithmetic

  • The alternative ##diff( end_time, start_time) is more like "arithmetic". This looks like the original intent of this function.

Which one do we like better?

_tom

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

Search



Quick Links

User menu

Not signed in.

Misc Menu