You are here: Documentation » Tips, Tricks, Tutorials, and Screencasts » Changing timezones in a timestamp
This is an old revision of the document!
Table of Contents
Changing timezones in a timestamp
By default PHP's date() function (and in turn, SimplePie's get_date() method) return the timestamp according to the web server's timezone. But what if your timezone and your server's are different and you want to display yours?
PHP 5.1 or newer
Use the date_default_timezone_set() function with a timezone parameter from the timezone page.
date_default_timezone_set('America/Los_Angeles');
PHP 5.0.x or earlier
Use the putenv() function as documented in this comment.
tutorial/changing_timezones_in_a_timestamp.1179896214.txt.gz · Last modified: 2011/03/06 03:56 (external edit)