21 Mar 09 _ How to change the default server time on GoDaddy (linux)

By Christopher
in BlogTorials, Development
I found this easy solution for changing GoDaddy’s default server time so my PHP 4 scripts would display the proper dates and times when fetching and displaying an RSS feed with Simplepie. Just add this code to your script before you include the “simplepie.inc” file (or before you begin to calculate dates or times on the page):
<?php
//set timezone
putenv ('TZ=America/New_York');
mktime(0,0,0,1,1,1970);
?>
Just replace America/New_York with whatever your local time zone is. Check this page for valid entries: http://us.php.net/manual/en/timezones.america.php
For PHP5.1 or newer use date_default_time(’America/New_York’).
Also check this page in the Simplepie docs for reference.
Cheers!








