note 26847 added to function.strftime
| From: | mbostrom at paragee dot com | Date: | Thu, 14 Nov 2002 19:31:19 +0000 |
| Subject: | note 26847 added to function.strftime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39500@lists.php.net to get a copy of this message | ||
If you are building a web app that will be used by people different timezones from the server on
which the app is running, you can switch the timezone on the fly by doing the following before
calling strftime (), or the other timestamp processing functions.
This is very easy if you know how to do it. If you don't you'll spend hours trying to
manually slide timestamps around.
putenv ("TZ=PST8PDT");
print strftime ("%T %Z");
putenv ("TZ=EST8EDT");
print strftime ("%T %Z");
Valid timezone codes can (usually) be seen (on Linux, at least) in /usr/share/zoneinfo or
/usr/lib/zoneinfo (according to the tzset manpage).
--
http://www.php.net/manual/en/function.strftime.php
http://master.php.net/manage/user-notes.php?action=edit+26847
http://master.php.net/manage/user-notes.php?action=delete+26847
http://master.php.net/manage/user-notes.php?action=reject+26847