Re: datetime:diff() question

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

The manual says this:

manual said...

Comments:

dt2 is subtracted from dt1, therefore, you can come up with a negative value.

But the code says this:

public function diff(datetime dt1, datetime dt2) 
    return datetimeToSeconds(dt2) - datetimeToSeconds(dt1) 
end function 

If I am indeed "subtracting dt2 from dt1" then I would write that as dt1 - dt2.

I am not sure which is supposed to be correct, the code or the manual.

-Greg

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

Search



Quick Links

User menu

Not signed in.

Misc Menu