jq beginner jq beginner - 4 months ago 16
PHP Question

default time zone is not changing using php or php.ini

i'm trying to change the default time zone using php but not working

date_default_timezone_set('Asia/Riyadh')


and tried using php.ini

date.timezone="Asia/Riyadh"


but in phpinfo i get this

Default timezone Europe/Berlin
date.timezone Europe/Berlin Europe/Berlin


and when inserting time to MySQL using CURTIME() i don't get Asia/Riyadh time and get a wrong time
update (timezone changed after awhile but using CURTIME() to insert date into mysql doesn't enter the right time

Answer

in php.ini

date.timezone="Asia/Riyadh"

and in my script

$nowtime = date("G:i:s");
$nowdate = date("Y-m-d");