note 27516 modified in function.localtime by danbrown

From: Date: Sun, 20 Jul 2008 03:23:03 +0000
Subject: note 27516 modified in function.localtime by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142058@lists.php.net to get a copy of this message
You can implement gmtime quote simply. <?php function GetTZOffset() { $Offset = date("O", 0); $Parity = $Offset < 0 ? -1 : 1; $Offset = $Parity * $Offset; $Offset = ($Offset - ($Offset % 100))/100*60 + $Offset % 100; return $Parity * $Offset; } $TZOffset = GetTZOffset(); $t_time = time()-$TZOffset*60; #Counter adjust for localtime() $t_arr = localtime($t_time); ?> --was-- You can implement gmtime quote simply. function GetTZOffset() { $Offset = date("O", 0); $Parity = $Offset < 0 ? -1 : 1; $Offset = $Parity * $Offset; $Offset = ($Offset - ($Offset % 100))/100*60 + $Offset % 100; return $Parity * $Offset; } $TZOffset = GetTZOffset(); $t_time = time()-$TZOffset*60; #Counter adjust for localtime() $t_arr = localtime($t_time); http://php.net/manual/en/function.localtime.php

« previous php.notes (#142058) next »