title: Client Time shown instead of server Time in javascript
body: <p>I am into strange issue of javascript <code>Date()</code> function, these are the details</p>
  
  <blockquote>
    <p>Server Side : Struts (ActionForm, Action class, jsp)<br>
    Client Side : jQuery, javascript</p>
  </blockquote>
  
  <p>Now, I need a server time on the page and manipulate using javascript. So, I did  <code>Calendar.getInstance().getTimeinMillis();</code> in the action class and save it as an ActionForm attribute.</p>
  
  <p>Now, at the client side, I got the long value (timeinMillis) from the styleId. But, to manipulate, when I do </p>
  
  <pre><code>var curTime = parseInt($("#serverTime").val());
  var serverTime = new Date(curTime);
  </code></pre>
  
  <p>Now, the serverTime is providing client machine date and not server date though we are providing timeinMillis of server.</p>
  
  <p>The strange part is when I pass string value of a date instead of long timeinMillis from server and pass it as an argument, it works well.</p>
  
  <p>Any idea?</p>