Consider the below code that prints today’s date -
All looks good? Let us now create a target date for my payment - it is 1.5 months from now.
Don’t mind the day gap, we are just living in the wrong time zone. We are happy with 15-Jun allright.
Wait, there is another way to set dates. We will try that for the heck of it.
We have just added a month to my target payment date. There is a God?
Not so great news if you are on the business side of things. And, the not-so-funny thing - I did not notice this until it “failed” in production.
Why did this happen? It turns out there is a legit reason.
When you input a
- Month will be set to ‘June’
- Date will be defaulted to today’s date (='31’) since there was no date provided (as yet)
End result - 15-Jul-2019.
Hmm.. it is time for a break. Where can I find the nearest ☢ 💥?