Fix: formatToD month bug on the 31st

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.