Whats wrong?Thanks for replays!
Edit: i just tried to do calculation inserting in $endDate date from 2016-10-20 TO 2016-10-31 .
for all days it was correct exept the last date of the month 2016-10-31 , its like it ignors last day of the month
did you ever hear that clocks are set forward/backward exactly one hour twice a year? it’s called DTS - daylight saving time. DTS may be available in your country check out your local documentation for “october 31 2016”.