I have a CRON job set to run every hour (have to do it this often due to scheduling facilities on server) and one of the sections of the script is to check if a closing date for entries into an event is within 2 days and if so to email a reminder for payment to those who have not yet paid. When I tested it it seemed to work but a closing date is tomorrow and the emails didn't go out yesterday. I am looking for suggestions on how I can get this to work.
My current if statement is
if ($result['show_closing'] == date('Y-m-d', strtotime('+2 days'))) { // send email and updated the customer fes record to indicate that a reminder has been sent so it only does it once
The date is stored as date format in the database YYYY-MM-DD.
Any ideas please?