note 1266 modified in date by ronabop
| From: | ronabop@php.net | Date: | Sun, 20 Aug 2000 11:38:35 +0000 |
| Subject: | note 1266 modified in date by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-2779@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";
http://www.php.net/manual/function.date.php