Reputation: 13688
I need to make a simple if statement for a daily cron job to check if today is the first saturday of the month. How would I modify the following code to do that instead of just running on the 1st of every month?
if (date("j") == 1) {
// run cron here
}
Upvotes: 0
Views: 344
Reputation: 75588
The first saturday of the month is the saturday where the day number is 7 or less.
Upvotes: 5