[misc] Better date computation