I am working with php and have to compare some data created between the first of the current month and the first of the next month.
I use date('Y-m-d', strtotime('+1 month'));
to get the first of the next month. Does this mean that I get the January 1st 2019 when the current date is e.g. 2018-12-16? Or does strtotime('+1 month')
just adds the next month and ignores the year, so the result would be 2018-01-16...?
I am not sure, if this is the way strtotime('+1 month')
works and I can't test it with a hardcoded month; date('Y-12-d', strtotime('+1 month'));
returns 2018-12-28... Did I even test it in the correct way?
Thanks for your help!