Fix: formatToD month bug on the 31st

Fixed a bug in formatToD function :
On the 31st of a month, setMonth(n) with n being a 30-day month return n+1.
Passing arguments to new Date() avoids this issue.
This bug only happens on the 31st of a month.