note 10140 deleted from function.date by jimw

From: Date: Fri, 02 Nov 2001 00:49:21 +0000
Subject: note 10140 deleted from function.date by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-20065@lists.php.net to get a copy of this message
PHP4 and timezone. Need to discard first read and print second. Like so: function showtime($tz,$t) { putenv("TZ=$tz"); $wrong = strftime("%c",$t); $right = strftime("%c",$t); print "Timezone: $tz<br>Wrong: $wrong<br>Right: $right<br><hr>\n"; } $t=gmmktime(0,0,0,12,01,2000); showtime("Australia/Adelaide",$t); showtime("Europe/Riga",$t); showtime("Europe/London",$t); showtime("Australia/Melbourne",$t); ?> Displays: Timezone: Australia/Adelaide Wrong: Fri Dec 1 02:00:00 2000 Right: Fri Dec 1 10:30:00 2000 Timezone: Europe/Riga Wrong: Fri Dec 1 10:30:00 2000 Right: Fri Dec 1 02:00:00 2000 Timezone: Europe/London Wrong: Fri Dec 1 02:00:00 2000 Right: Fri Dec 1 00:00:00 2000 Timezone: Australia/Melbourne Wrong: Fri Dec 1 00:00:00 2000 Right: Fri Dec 1 11:00:00 2000

« previous php.notes (#20065) next »