title: How can I update the time from chosen timezone every minute on my webpage?
body: <p>I have a jquery function that uses moment.js to calculate time in different timezone based on the clock in the client's system:</p>
  
  <pre><code>function updateTime(){
                  var chicago = moment.tz("America/Chicago").format('h:mm:ss A');
                 $('#time').html( chicago +", ");
              };
  
              moment.tz.add('America/Chicago|CST CDT|60 50|01010101010101010101010|1BQU0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0');                                                                         
  
              updateTime();
              setInterval(function(){
                 updateTime();
              },1000);
  </code></pre>
  
  <p>It works pretty nice, however when user changes his system clock, then the momentjs shows incorrect time. I figured out I can fetch timestamp from the server (by php) and use it as a start time for updating time on client's webpage. I tried to write a script as follows:</p>
  
  <pre><code>function updateTimeBasedOnServer(){
                  var timestamp = 1443618723;
                  var Chicago = new Date(timestamp);
                  var dateString = Chicago.format('h:mm:ss A');
                 $('#time2').html( dateString +", ");
              };
  
  
              updateTimeBasedOnServer();
              setInterval(function(){
                 updateTimeBasedOnServer();
              },1000);
  </code></pre>
  
  <p>But it doesn't work. I want to have the same result as after running the first script, but with only the difference that it works independently from the user's clock in his system. How can I do that?
  Here is my fiddle: 
  <a href="http://jsfiddle.net/b8o5cvdz/9/" rel="nofollow">http://jsfiddle.net/b8o5cvdz/9/</a></p>