Time Difference Exists Between the Client and the Server
<p>Javascript:</p>

<pre><code>function setinvitexpire(){

var ee = new Date ();
ee.setTime(ee.getTime() + (365 * 24 * 3600 * 1000));

var bb = Math.round(new Date().getTime() / 1000) + (24 * 3600); // remove milliseconds

document.cookie="visit=" + bb + ";expires=" + ee.toGMTString();

}
setinvitexpire();
</code></pre>

<p>PHP:</p>

<pre><code>&lt;?php 
if(isset($_COOKIE['visit'])){ 
echo date('m/d/Y g:i A', $_COOKIE['visit']); 
echo "&lt;br&gt;";
} 
?&gt;
</code></pre>

<p>I get:</p>

<pre><code>06/26/2012 11:57 AM
</code></pre>

<p>instead of:</p>

<pre><code>06/26/2012 18:07 AM
</code></pre>

<p>because the current time in my country is <strong>06/25/2012 18:07 AM</strong></p>

<p>How can I resolve this and simply save the current time + 24hours in a cookie ?</p>

<p>EDIT:
I resolved in this way:</p>

<pre><code>document.cookie="visit=" + &lt;?php echo time() + (24 * 3600); ?&gt; + ";expires=" + ExpireC.toGMTString();
</code></pre>
