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


i have 2 functions checking if today first day of month. 1 of these have advantage on other, ie accuracy?

if(date('j', $timestamp) === '1') { }  if(date('y-m-d') == date('y-m-01')) { } 

the first 1 less checking use that.

you don't need timestamp argument if want check / today


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -