title: show real time clock on html using javascript
body: <p>can someone help me with this code, I'm really bad using JS</p>
  <p>I want to show only Brazil time in the application, regardless of where the user accesses the application.</p>
  <pre><code>&lt;head&gt;
      &lt;script&gt;
          function display_c() {
              var refresh = 1000; // Refresh rate in milli seconds
              mytime = setTimeout('display_ct()', refresh)
          }
  
          function display_ct() {
              var strcount
              var x = new Date().toLocaleString(&quot;en-US&quot;, {timeZone: &quot;America/Sao_Paulo&quot;});
              var x1 = x.getMonth() + 1 + &quot;/&quot; + x.getDate() + &quot;/&quot; + x.getYear();
              x1 = x1 + &quot; - &quot; + x.getHours( ) + &quot;:&quot; + x.getMinutes() + &quot;:&quot; + x.getSeconds();
              document.getElementById('ct').innerHTML = x1;
  
              tt = display_c();
          }
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onload=display_ct();&gt;
      &lt;span id='ct' &gt;&lt;/span&gt;
  &lt;/body&gt;
  </code></pre>
  <p>Error</p>
  <pre><code>painel:48 Uncaught TypeError: x.getMonth is not a function
  at display_ct (painel:48)
  at onload (painel:57)
  </code></pre>