title: how to run a javascript function on the given date time
body: <p>I want to run some specific <code>javascript function</code> on the given date/time only once. 
  For example I have a date time variable in <code>php</code> as below.</p>
  
  <pre><code>  $date = "May 7, 2015 17:08:43";
  </code></pre>
  
  <p>I have some function like</p>
  
  <pre><code> function some_function()
   {
     .....
     .....
   } 
  </code></pre>
  
  <p>How can I run this function only once on the given date time <code>May 7, 2015 17:08:43</code>. </p>
  
  <p>I tried this but it's not working correctly.</p>
  
  <pre><code>var date = "&lt;?php echo date('n/j/Y/H:i', strtotime($date));?&gt;";
  var myDate = new Date();
  var current_date =  (myDate.getMonth()+1)  + "/" + myDate.getDate() + "/" + myDate.getFullYear()+ "/"+ myDate.getHours() + ":" + myDate.getMinutes();
  var interval = setInterval(function() { 
      if(date==current_date)
      {
         some_function();           
  
      }
  
  }, 4000);
  clearInterval(interval);
  </code></pre>
  
  <p>Is there any good technique for this?</p>