Best way to check if today is the first of the month

date, php

Solution

The first one does less checking I would use that.

You also don't need the timestamp argument if you want to check now / today

Problem

I have 2 functions for checking if today is the first day of the month. Does one of these have an advantage over the other, ie accuracy? ``` if(date('j', $timestamp) === '1') { } if(date('Y-m-d') == date('Y-m-01')) { } ```

Original source

Related problems