title: How to create a notification system for 30 days interval
body: <p>I want to create a notification for warranty expiry date. the notification should be appear on the panel before 15 days of expiry and it will last on panel after 15 days of expiry and then goes to archive. </p>
  
  <p>my php code </p>
  
  <pre><code>&lt;?php
  $exp_date = strtotime('2017-05-01');
  $notify_start_date = strtotime('-15 days',$exp_date );
  $notify_end_date = strtotime('+15 days', $exp_date);
  $now = new DateTime();
  $now = $now-&gt;format('Y-m-d');
  $now = strtotime($now);
  
  
  echo 'expiry date---&gt;'.date('Y-m-d',$exp_date).'&lt;br&gt;';
  echo 'nofity start date---&gt;'.date('Y-m-d',$notify_start_date).'&lt;br&gt;';
  echo 'nofity end date---&gt;'.date('Y-m-d',$notify_end_date).'&lt;br&gt;';
  echo 'today---&gt;'.date('Y-m-d',$now).'&lt;br&gt;';
  
  
  if ( $exp_date &gt; $notify_start_date  &amp;&amp;  $exp_date &lt; $notify_end_date ) {
      if ($exp_date &lt; $now) {
          echo "already expired";
      } 
      if ($exp_date == $now) {
          echo "will expire today";
      }
      if ($exp_date &gt; $now) {
          echo "going to expire ";
      }
  } else {
      echo 'false';
  }
  ?&gt;
  </code></pre>
  
  <p>my code shows the notification beyond 15 days in both case before and after
  if I give the date 2017-06-31 still show in the notification panel and showing all the expired date from the past </p>