title: JavaScript Converting System TimeZone + 15 minutes?
body: <p>My system time is UTC + 0 as I am in the UK.</p>
  
  <p><strong>My Script:</strong></p>
  
  <pre><code>&lt;script&gt;
  // Set the date we're counting down to
  var countDownDate = new Date("&lt;?php echo $date ?&gt;").getTime();
  
  // Update the count down every 1 second
  var x = setInterval(function() {
  
      // Get todays date and time
      var now = new Date().getTime();
  
      // Find the distance between now an the count down date
      var distance = countDownDate - now;
  
      // Time calculations for days, hours, minutes and seconds
      var days = Math.floor(distance / (1000 * 60 * 60 * 24));
      var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
      var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
      var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  
      // Output the result in an element with id="demo"
      document.getElementById("time").innerHTML = minutes + "m " + seconds + "s ";
  
      // If the count down is over, write some text 
      if (distance &lt; 0) {
          clearInterval(x);
          document.getElementById("time").innerHTML = "EXPIRED";
          window.location.href = "/error";
      }
  }, 1000);
  &lt;/script&gt;
  </code></pre>
  
  <p>My PHP will echo a date + 15 minutes gotten from the serverside, a users order will expire after 15 minutes you see.</p>
  
  <p>So here is a date that the countdown timer would use (2017-11-23 22:50:18) this would be 15 minutes from now, but is UTC + 0 time.</p>
  
  <p>If the users system time was in another country or behind then it would expire and go to the error page straight away.</p>
  
  <p>How would I convert this time to the users timezone (And even if they refresh the page the timer would still be counting down)</p>
  
  <p>The PHP var for $date is gotten from the database and is laid out like so: "2017-11-23 22:50:18"</p>
  
  <p>How do I convert this to the system time of the user?</p>
  
  <p><strong>I hope you understand me, thanks very much! :)</strong></p>