title: jQuery Datepicker unix timestamp
body: <p>I add a datepicker with jQuery datepicker and make use of the altFormat '@' --> see <a href="http://docs.jquery.com/UI/Datepicker/formatDate">http://docs.jquery.com/UI/Datepicker/formatDate</a></p>
  
  <pre><code> // Function datepicker
          $("#obsDate").datepicker({
              altField: '#actualDate',
              altFormat: '@',        // Gives a timestamp dateformat
              dateFormat: "dd-mm-yy",
              showOn: "button",
              buttonImage: $("#datePickerImg").val(),
              buttonImageOnly: true,
          });
  </code></pre>
  
  <p>When the user picks a value the unix timestamp is set.
  Like : 1312840800000</p>
  
  <p>This is  in miliseconds so i id do /1000</p>
  
  <p>But when i convert the timestamp with the function in C#</p>
  
  <pre><code>private static DateTime ConvertFromUnixTimestamp(double timestamp)
          {
              var origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
              return origin.AddSeconds(timestamp);
          }
  </code></pre>
  
  <p>I get always one day ealier..</p>
  
  <p>What i'm doing wrong?</p>
  
  <p><strong>UPDATED:</strong>
  When i use the build in function of javascript gettime()</p>
  
  <pre><code>var ts = Math.round((new Date().getTime() / 1000));
  </code></pre>
  
  <p>I get the right timestamp...</p>
  
  <ul>
  <li>Example with getTime() i get:
  30-08-2011 --> 1314628036</li>
  </ul>
  
  <p>Example with the datepicker i get :
  29-08-2011 --> 1314568800.</p>
  
  <p>This is also with ticks (!) in the datepicker.</p>