title: How to restrict access between days and times?
body: <p>I like to add php-script for only allowing posts, comment between these days and times:</p>
  
  <pre><code>Monday-Friday: 09.00 - 19.00
  Saturday: 10.00-15.00
  </code></pre>
  
  <p>All other times the post function shall not be available. Any idea in how I do that?</p>
  
  <p>Started with this but then I realized I need days as well:</p>
  
  <pre><code>&lt;?php date_default_timezone_set('Europe/Stockholm'); // NDT 
  $startTime = '09:00'; //opening hours starts
  $endTime = '14:00'; //closing hours 
  $time = new DateTime($startTime); 
  $time1 = date_format($time, 'H:i'); 
  $time = new DateTime($endTime); 
  $time2 = date_format($time, 'H:i');
  
  "Today is " . $current =date("H:i") . "&lt;br&gt;";
  
  if ($current &gt; $time1 &amp;&amp; $current &lt; $time2) {
       echo 'The pposting is closed from 13.00 - 09.00. Sorry for the Inconvenience.'; }
  else{
     echo "It's open";
  }
  </code></pre>