I'm on the next stage of my tutorial and I'm learning about timestamps and cookies.
The tutorial gives me this code to store the cookie:
To retrieve the cookie and create a response, I'm given this code:Code:<?php //Calculate 60 days in the future //seconds * minutes * hours * days + current time $inTwoMonths = 60 * 60 * 24 * 60 + time(); setcookie('lastVisit', date("G:i - m/d/y"), $inTwoMonths); ?>
The problem I am having is that it's currently BST here, not GMT and the server thinks it is 00:30, when in fact it is 01:30.Code:<?php if(isset($_COOKIE['lastVisit'])) $visit = $_COOKIE['lastVisit']; else echo "You've got some stale cookies!"; echo "Your last visit was - ". $visit; ?>
I can't seem to figure out how to fix this.. any ideas how I can?
Thanks in advance guys.
~RTriggerHappy


Reply With Quote
Bookmarks