Showing the Current Date
Monday September 10, 2007
Displaying the current date on your website is as simple as one line of code. It uses both the print and date functions to generate today's date on your website.
Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >
Easy ways to connect two computers for networking purposes. More >
©2009 About.com, a part of The New York Times Company.
All rights reserved.
Regarding your PHP Cookie tutorial at
http://php.about.com/od/advancedphp/qt/php_cookie.htm
The tutorial works but shows the server time. How do I offset the time for my time zone? I am central and my server time is an hour ahead of me.
Thanks.
http://us.php.net/date
See the Z option
I just can’t get it to work. I have visited http://us.php.net/date before and did it again just now to see if I could make heads or tails of it. No go.
This is what I am getting from the cookie:
Welcome back! You last visited on September 12th, 2007 @ 7:14 AM
However, the time right now should be 6:14 AM because I am in a different time zone than my server.
What do I put in this following code of yours to offset the time back an hour from the server time:
?php
$Month = 31536000 + time() ;
//this adds 365 days to the current time
setcookie(JodySite1, date(”F jS, Y @ g:i A”), $Month);
?