title: Javascript how to verify day by getDay when using timezone
body: <p>I am trying to verify that the day of the week is equal to Wednesday (3), and this works well if I do as following.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var today = new Date();
  
  if (today.getDay() == 3) {
    alert('Today is Wednesday');
  } else {
   alert('Today is not Wednesday');
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>But I am unable to do the same with a time zone.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var todayNY = new Date().toLocaleString("en-US", {timeZone: "America/New_York"});
  
  if (todayNY.getDay() == 3) {
    alert('Today is Wednesday in New York');
  } else {
   alert('Today is not Wednesday in New York');
  }</code></pre>
  </div>
  </div>
  </p>