title: Timer is different than the proper time
body: <p>I have a time difference between the actual time of a listing and the time shown by the timer code.
  So, for a listing, this code show the remaining time as 8d 18h 23m 58s GTB Standard Time instead of the real one of 9d, 1h, 23m, 45s.</p>
  <p>Can anyone pinpoint why this happens and also if there is any solution to fix it (or at least stop it to show the text GTB Standard Time, so just the actual time). Thank you</p>
  <pre><code>function timelefttolistnewtimer(){
  
  var arr = [];
  var offset = getTimezoneName();
  
  jQuery('.timelefttolistnewtimer').each(function(k,v) {
      
      var id = jQuery(this).attr('id');
      
      
      arr[&quot;countDownDate&quot;+id] = new Date(jQuery(this).data('time')).getTime();
      
  
      // Update the count down every 1 second
      arr[&quot;x&quot;+id] = setInterval(function() {
  
        // Get today's date and time
        arr[&quot;now&quot;+id]= new Date().getTime();
          
        // Find the distance between now and the count down date
        arr[&quot;distance&quot;+id] = arr[&quot;countDownDate&quot;+id]- arr[&quot;now&quot;+id];
          
        // Time calculations for days, hours, minutes and seconds
        arr[&quot;days&quot;+id] = Math.floor(arr[&quot;distance&quot;+id] / (1000 * 60 * 60 * 24));
        arr[&quot;hours&quot;+id] = Math.floor((arr[&quot;distance&quot;+id] % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
        arr[&quot;minutes&quot;+id] = Math.floor((arr[&quot;distance&quot;+id] % (1000 * 60 * 60)) / (1000 * 60));
        arr[&quot;seconds&quot;+id] = Math.floor((arr[&quot;distance&quot;+id] % (1000 * 60)) / 1000);
          
        // Output the result in an element with id=&quot;demo&quot;
        jQuery(&quot;#&quot;+id).html(arr[&quot;days&quot;+id] + &quot;d &quot; + arr[&quot;hours&quot;+id] + &quot;h &quot;
        + arr[&quot;minutes&quot;+id] + &quot;m &quot; + arr[&quot;seconds&quot;+id] + &quot;s &quot; + offset);
      
        console.log('arr');
          console.log(arr[&quot;seconds&quot;+id]);
          console.log(offset);
          
        // If the count down is over, write some text 
        if (arr[&quot;distance&quot;+id] &lt; 0) {
          clearInterval(arr[&quot;x&quot;+id]);
          jQuery(&quot;#&quot;+id).html(&quot;EXPIRED&quot;);
        }
      }, 1000);
  
  
  });
  </code></pre>
  <p>}</p>
  <pre><code>function timelefttolistnewtimer1(){
  
  var arr = [];
  var offset = getTimezoneName();
  
  jQuery('.timelefttolistnewtimer1').each(function(k,v) {
      
      var id = jQuery(this).attr('id');
  
      
      
      arr[&quot;countDownDate&quot;+id] = new Date(jQuery(this).data('time')).getTime();
      
  
      // Update the count down every 1 second
      arr[&quot;x&quot;+id] = setInterval(function() {
  
        // Get today's date and time
        arr[&quot;now&quot;+id]= new Date().getTime();
          
        // Find the distance between now and the count down date
        arr[&quot;distance&quot;+id] = arr[&quot;countDownDate&quot;+id]- arr[&quot;now&quot;+id];
          
        // Time calculations for days, hours, minutes and seconds
        arr[&quot;days&quot;+id] = Math.floor(arr[&quot;distance&quot;+id] / (1000 * 60 * 60 * 24));
        arr[&quot;hours&quot;+id] = Math.floor((arr[&quot;distance&quot;+id] % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
        arr[&quot;minutes&quot;+id] = Math.floor((arr[&quot;distance&quot;+id] % (1000 * 60 * 60)) / (1000 * 60));
        arr[&quot;seconds&quot;+id] = Math.floor((arr[&quot;distance&quot;+id] % (1000 * 60)) / 1000);
          
        // Output the result in an element with id=&quot;demo&quot;
       
  
        jQuery(&quot;#&quot;+id).html(arr[&quot;days&quot;+id] + &quot;d &quot; + arr[&quot;hours&quot;+id] + &quot;h &quot;
        + arr[&quot;minutes&quot;+id] + &quot;m &quot; + arr[&quot;seconds&quot;+id] + &quot;s &quot; + offset);
  
  
        //console.log('arr');
          //console.log(arr[&quot;seconds&quot;+id]);
          //console.log(offset);
          
        // If the count down is over, write some text 
        if (arr[&quot;distance&quot;+id] &lt; 0) {
          clearInterval(arr[&quot;x&quot;+id]);
          jQuery(&quot;#&quot;+id).html(&quot;EXPIRED&quot;);
        }
      }, 1000);
  
  
  });
  </code></pre>
  <p>}</p>
  <pre><code>function getTimezoneName() {
  var timeSummer = new Date(Date.UTC(2005, 6, 30, 0, 0, 0, 0));
  var summerOffset = -1 * timeSummer.getTimezoneOffset();
  var timeWinter = new Date(Date.UTC(2005, 12, 30, 0, 0, 0, 0));
  var winterOffset = -1 * timeWinter.getTimezoneOffset();
  var timeZoneHiddenField;
  
  if (-720 == summerOffset &amp;&amp; -720 == winterOffset) { timeZoneHiddenField = 'Dateline Standard Time'; }
  else if (-660 == summerOffset &amp;&amp; -660 == winterOffset) { timeZoneHiddenField = 'UTC-11'; }
  else if (-660 == summerOffset &amp;&amp; -660 == winterOffset) { timeZoneHiddenField = 'Samoa Standard Time'; }
  else if (-660 == summerOffset &amp;&amp; -600 == winterOffset) { timeZoneHiddenField = 'Hawaiian Standard Time'; }
  else if (-570 == summerOffset &amp;&amp; -570 == winterOffset) { timeZoneHiddenField.value = 'Pacific/Marquesas'; }
  //                else if (-540 == summerOffset &amp;&amp; -600 == winterOffset) { timeZoneHiddenField.value = 'America/Adak'; }
  //                else if (-540 == summerOffset &amp;&amp; -540 == winterOffset) { timeZoneHiddenField.value = 'Pacific/Gambier'; }
  else if (-480 == summerOffset &amp;&amp; -540 == winterOffset) { timeZoneHiddenField = 'Alaskan Standard Time'; }
  //                else if (-480 == summerOffset &amp;&amp; -480 == winterOffset) { timeZoneHiddenField = 'Pacific/Pitcairn'; }
  else if (-420 == summerOffset &amp;&amp; -480 == winterOffset) { timeZoneHiddenField = 'Pacific Standard Time'; }
  else if (-420 == summerOffset &amp;&amp; -420 == winterOffset) { timeZoneHiddenField = 'US Mountain Standard Time'; }
  else if (-360 == summerOffset &amp;&amp; -420 == winterOffset) { timeZoneHiddenField = 'Mountain Standard Time'; }
  else if (-360 == summerOffset &amp;&amp; -360 == winterOffset) { timeZoneHiddenField = 'Central America Standard Time'; }
  //                else if (-360 == summerOffset &amp;&amp; -300 == winterOffset) { timeZoneHiddenField = 'Pacific/Easter'; }
  else if (-300 == summerOffset &amp;&amp; -360 == winterOffset) { timeZoneHiddenField = 'Central Standard Time'; }
  else if (-300 == summerOffset &amp;&amp; -300 == winterOffset) { timeZoneHiddenField = 'SA Pacific Standard Time'; }
  else if (-240 == summerOffset &amp;&amp; -300 == winterOffset) { timeZoneHiddenField = 'Eastern Standard Time'; }
  else if (-270 == summerOffset &amp;&amp; -270 == winterOffset) { timeZoneHiddenField = 'Venezuela Standard Time'; }
  else if (-240 == summerOffset &amp;&amp; -240 == winterOffset) { timeZoneHiddenField = 'SA Western Standard Time'; }
  else if (-240 == summerOffset &amp;&amp; -180 == winterOffset) { timeZoneHiddenField = 'Central Brazilian Standard Time'; }
  else if (-180 == summerOffset &amp;&amp; -240 == winterOffset) { timeZoneHiddenField = 'Atlantic Standard Time'; }
  else if (-180 == summerOffset &amp;&amp; -180 == winterOffset) { timeZoneHiddenField = 'Montevideo Standard Time'; }
  else if (-180 == summerOffset &amp;&amp; -120 == winterOffset) { timeZoneHiddenField = 'E. South America Standard Time'; }
  else if (-150 == summerOffset &amp;&amp; -210 == winterOffset) { timeZoneHiddenField = 'Mid-Atlantic Standard Time'; }
  else if (-120 == summerOffset &amp;&amp; -180 == winterOffset) { timeZoneHiddenField = 'America/Godthab'; }
  else if (-120 == summerOffset &amp;&amp; -120 == winterOffset) { timeZoneHiddenField = 'SA Eastern Standard Time'; }
  else if (-60 == summerOffset &amp;&amp; -60 == winterOffset) { timeZoneHiddenField = 'Cape Verde Standard Time'; }
  else if (0 == summerOffset &amp;&amp; -60 == winterOffset) { timeZoneHiddenField = 'Azores Daylight Time'; }
  else if (0 == summerOffset &amp;&amp; 0 == winterOffset) { timeZoneHiddenField = 'Morocco Standard Time'; }
  else if (60 == summerOffset &amp;&amp; 0 == winterOffset) { timeZoneHiddenField = 'GMT Standard Time'; }
  else if (60 == summerOffset &amp;&amp; 60 == winterOffset) { timeZoneHiddenField = 'Africa/Algiers'; }
  else if (60 == summerOffset &amp;&amp; 120 == winterOffset) { timeZoneHiddenField = 'Namibia Standard Time'; }
  else if (120 == summerOffset &amp;&amp; 60 == winterOffset) { timeZoneHiddenField = 'Central European Standard Time'; }
  else if (120 == summerOffset &amp;&amp; 120 == winterOffset) { timeZoneHiddenField = 'South Africa Standard Time'; }
  else if (180 == summerOffset &amp;&amp; 120 == winterOffset) { timeZoneHiddenField = 'GTB Standard Time'; }
  else if (180 == summerOffset &amp;&amp; 180 == winterOffset) { timeZoneHiddenField = 'E. Africa Standard Time'; }
  else if (240 == summerOffset &amp;&amp; 180 == winterOffset) { timeZoneHiddenField = 'Russian Standard Time'; }
  else if (240 == summerOffset &amp;&amp; 240 == winterOffset) { timeZoneHiddenField = 'Arabian Standard Time'; }
  else if (270 == summerOffset &amp;&amp; 210 == winterOffset) { timeZoneHiddenField = 'Iran Standard Time'; }
  else if (270 == summerOffset &amp;&amp; 270 == winterOffset) { timeZoneHiddenField = 'Afghanistan Standard Time'; }
  else if (300 == summerOffset &amp;&amp; 240 == winterOffset) { timeZoneHiddenField = 'Pakistan Standard Time'; }
  else if (300 == summerOffset &amp;&amp; 300 == winterOffset) { timeZoneHiddenField = 'West Asia Standard Time'; }
  else if (330 == summerOffset &amp;&amp; 330 == winterOffset) { timeZoneHiddenField = 'Indian Standard Time'; }
  else if (345 == summerOffset &amp;&amp; 345 == winterOffset) { timeZoneHiddenField = 'Nepal Standard Time'; }
  else if (360 == summerOffset &amp;&amp; 300 == winterOffset) { timeZoneHiddenField = 'N. Central Asia Standard Time'; }
  else if (360 == summerOffset &amp;&amp; 360 == winterOffset) { timeZoneHiddenField = 'Central Asia Standard Time'; }
  else if (390 == summerOffset &amp;&amp; 390 == winterOffset) { timeZoneHiddenField = 'Myanmar Standard Time'; }
  else if (420 == summerOffset &amp;&amp; 360 == winterOffset) { timeZoneHiddenField = 'North Asia Standard Time'; }
  else if (420 == summerOffset &amp;&amp; 420 == winterOffset) { timeZoneHiddenField = 'SE Asia Standard Time'; }
  else if (480 == summerOffset &amp;&amp; 420 == winterOffset) { timeZoneHiddenField = 'North Asia East Standard Time'; }
  else if (480 == summerOffset &amp;&amp; 480 == winterOffset) { timeZoneHiddenField = 'China Standard Time'; }
  else if (540 == summerOffset &amp;&amp; 480 == winterOffset) { timeZoneHiddenField = 'Yakutsk Standard Time'; }
  else if (540 == summerOffset &amp;&amp; 540 == winterOffset) { timeZoneHiddenField = 'Tokyo Standard Time'; }
  else if (570 == summerOffset &amp;&amp; 570 == winterOffset) { timeZoneHiddenField = 'Cen. Australia Standard Time'; }
  else if (570 == summerOffset &amp;&amp; 630 == winterOffset) { timeZoneHiddenField = 'Australia/Adelaide'; }
  else if (600 == summerOffset &amp;&amp; 540 == winterOffset) { timeZoneHiddenField = 'Asia/Yakutsk'; }
  else if (600 == summerOffset &amp;&amp; 600 == winterOffset) { timeZoneHiddenField = 'E. Australia Standard Time'; }
  else if (600 == summerOffset &amp;&amp; 660 == winterOffset) { timeZoneHiddenField = 'AUS Eastern Standard Time'; }
  else if (630 == summerOffset &amp;&amp; 660 == winterOffset) { timeZoneHiddenField = 'Australia/Lord_Howe'; }
  else if (660 == summerOffset &amp;&amp; 600 == winterOffset) { timeZoneHiddenField = 'Tasmania Standard Time'; }
  else if (660 == summerOffset &amp;&amp; 660 == winterOffset) { timeZoneHiddenField = 'West Pacific Standard Time'; }
  else if (690 == summerOffset &amp;&amp; 690 == winterOffset) { timeZoneHiddenField = 'Central Pacific Standard Time'; }
  else if (720 == summerOffset &amp;&amp; 660 == winterOffset) { timeZoneHiddenField = 'Magadan Standard Time'; }
  else if (720 == summerOffset &amp;&amp; 720 == winterOffset) { timeZoneHiddenField = 'Fiji Standard Time'; }
  else if (720 == summerOffset &amp;&amp; 780 == winterOffset) { timeZoneHiddenField = 'New Zealand Standard Time'; }
  else if (765 == summerOffset &amp;&amp; 825 == winterOffset) { timeZoneHiddenField = 'Pacific/Chatham'; }
  else if (780 == summerOffset &amp;&amp; 780 == winterOffset) { timeZoneHiddenField = 'Tonga Standard Time'; }
  else if (840 == summerOffset &amp;&amp; 840 == winterOffset) { timeZoneHiddenField = 'Pacific/Kiritimati'; }
  else { timeZoneHiddenField = 'US/Pacific'; }
  return timeZoneHiddenField;
  </code></pre>
  <p>}</p>
  <p>The code get's split wrong by stackoverflow, that's why i add it in 3 sections.</p>