title: Javascript Date() give wrong date off by one hour
body: <p>I send this date from my controller in java (<code>Spring-MVC</code>) the type in <code>mysql</code> is <code>datetime</code></p>
  
  <pre><code>@Temporal(TemporalType.TIMESTAMP) 
  @Column(name = "..") public Date getYy() { 
      return this.yy; 
  }
  </code></pre>
  
  <p>as : <code>[2015-09-30 00:00:00.0]</code></p>
  
  <p>When i get this dates with ajax as <code>1443567600000</code> :</p>
  
  <p><code>new Date(1443567600000)</code> convert to <code>Tue Sep 29 2015 23:00:00 GMT+0000 (Maroc)</code></p>
  
  <p>So why i get  wrong date off by one hour?</p>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>We resolve it by</p>
  
  <pre><code>d = new Date(value) ;
  d.setTime( d.getTime() - new Date().getTimezoneOffset()*60*1000 );
  </code></pre>
  
  <p>because it was Daylight saving time (DST) or summer time problem. good <a href="https://stackoverflow.com/questions/1091372/getting-the-clients-timezone-in-javascript">article</a></p>