note 80528 added to function.date-default-timezone-set

From: Date: Sun, 20 Jan 2008 21:01:14 +0000
Subject: note 80528 added to function.date-default-timezone-set
Groups: php.notes 
Request: Send a blank email to php-notes+get-135266@lists.php.net to get a copy of this message
<?php /** * @Author H22CREATIONS * @Copyright 2008 */ /*************************** * array get_time_byTZ([ integer $gmt_plus]) ****************************/ function get_time_byTZ($gmt_plus=0){//must be in [-12..12] //GET Difference between Server TZ and desired TZ $sec_diff=date('Z')-($gmt_plus*3600); //Return $gmt_plus as a string if ($gmt_plus>=0) $gmt_plus='+'.$gmt_plus; //Think about it! $time=strtotime($sec_diff=(($sec_diff<=0)?'+':'-').abs($sec_diff).' seconds'); return array($time,$gmt_plus,$sec_diff/3600); } //Test list($time,$gmt_plus,$tz_diffrence)=get_time_byTZ(-1); echo date('m/d/y G:i:s ',$time).$gmt_plus; ?> ---- Server IP: 69.147.83.197 Probable Submitter: 196.203.242.123 ---- Manual Page -- http://www.php.net/manual/en/function.date-default-timezone-set.php Edit -- https://master.php.net/note/edit/80528 Del: integrated -- https://master.php.net/note/delete/80528/integrated Del: useless -- https://master.php.net/note/delete/80528/useless Del: bad code -- https://master.php.net/note/delete/80528/bad+code Del: spam -- https://master.php.net/note/delete/80528/spam Del: non-english -- https://master.php.net/note/delete/80528/non-english Del: in docs -- https://master.php.net/note/delete/80528/in+docs Del: other reasons-- https://master.php.net/note/delete/80528 Reject -- https://master.php.net/note/reject/80528 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135266) next »