title: Use a cron job that runs every 15 minutes to do something once monthly
body: <p><strong>What I have:</strong>
  I have an existing cron job file that runs daily every 15 minutes (e.g. 1.10pm, 1.25pm, 1.40pm, 1.55pm), to check in the database for emails to be sent. I am using PHP and mySQL.</p>
  
  <p><strong>My issue:</strong>
  Due to a limit by the hosting, I have to use the same cron job file for another task - check the database at every end of the month.</p>
  
  <p><strong>My question 1:</strong> 
  I only want the check to be done once on that day - would my following solution work? If I don't want to update the database that I have done the check already, I will have to set the task to only be done if the time now is equal to 8.55am (a timing that the cron job would run at). So if the cron job runs at 8.55am, it would do</p>
  
  <pre><code>$TimeNow = new DateTime();
  $TimeNow = $TimeNow-&gt;format('H:i');
  $TimeToRun = new DateTime('8:55');
  $TimeToRun = $TimeToRun-&gt;format('H:i');
  if ($TimeNow == $TimeToRun) {check database}
  </code></pre>
  
  <p><strong>My question 2:</strong> Would the following work to check if it is the end of the month? What can I do to check if this works because it is not the end of the month now?</p>
  
  <pre><code>if(gmdate('t') == gmdate('d')){} 
  </code></pre>