title: Comparing client time on the server
body: <p>If I have a string of the following format on the server, which could be in any timezone:</p>
  
  <pre><code>var timeString = 2014-05-24T14:00:00.000Z
  </code></pre>
  
  <p>What is the best way to to compare the hour represented by the string with the hour that a client may pass in as part of a GET request (Node.js)?</p>
  
  <p>I need help because the date on the server and the date received from the client may be in Daylight Savings time, or in different timezones.</p>
  
  <p>I tried passing in the client time as the number of milliseconds since Unix epoch:</p>
  
  <pre><code>var clientTime = new Date(parseInt(req.query.localTime));
  var serverTime = new Date(timeString);
  if (serverTime.getUTCHours() == clientTime.getUTCHours()) {
      // the hours match
  }
  </code></pre>
  
  <p>But it doesn't seem to work out.</p>