Question #172656 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/172656

RaiMan posted a new comment:
@ vitalliuss

The above solution is only usable if you accept the leap years problem, when 
dividing by 365.
The time delta counts days, which do not have a leap year problem.

BTW: timedelta.days/365 gives 22 and not 22.6 (integer division)

So for this purpose the leap years do no harm.

But if you really want to minimize the "error":
correctLeap = 365*4+1
theDays = timedelta.days
years = (theDays - theDays/correctLeap)/365

this corrects the days value by subtracting the contained leap days
before dividing by 365 (error +/-1)

But this does not take into account, that years ending with 00 are
normal years ;-)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to