note 1266 deleted from function.date by jimw
| From: | jimw@php.net | Date: | Fri, 02 Nov 2001 00:21:11 +0000 |
| Subject: | note 1266 deleted from function.date by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20031@lists.php.net to get a copy of this message | ||
Convert Times between Timezones
// First set the Timezone
// (see the zoneinfo directory-tree on your System for a list
// it is in /usr/share/zoneinfo on my System)
putenv("TZ=Europe/Rome");
// Calculate the Timstamp relative to the Timezone
$timestamp=mktime($hour,$minutes,$seconds,$month,$day,$year);
// Show the time
echo "Date ".date("d/m/Y H:i:s",$timestamp)." in ".getenv
("TZ")."\n";
// Now Change the Timezone
putenv("TZ=Australia/Adelaide");
// Show the time
echo "Date ".date("d/m/Y H:i:s",$timestamp)." in ".getenv
("TZ")."\n";