note 104493 modified in timezones.asia by danbrown

From: Date: Mon, 20 Jun 2011 15:39:03 +0000
Subject: note 104493 modified in timezones.asia by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-180788@lists.php.net to get a copy of this message
Even though php supports 'Asia/Riyadh', MySQL doesn't! I had to use '+3:00' instead, to over come that since it's pointless to set the time zone for the script and not the database activities. To do it for both, do the following : <?php $timezone = "Asia/Riyadh"; if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone); mysql_query("SET SESSION time_zone = '+3:00'"); ?> --was-- Even though php supports 'Asia/Riyadh', MySQL doesn't! I had to use '+3:00' instead, to over come that since it's pointless to set the time zone for the script and not the database activities. To do it for both, do the following : $timezone = "Asia/Riyadh"; if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone); mysql_query("SET SESSION time_zone = '+3:00'"); http://php.net/manual/en/timezones.asia.php

« previous php.notes (#180788) next »