In php, is there a way to set default timezone in .htaccess or wherever, as long as i don have to set it at every php page.
provided i don have access to server, only PHP files. Thanks in advance
UPDATE
i am using apache (LAMP), and don't have access to php.ini
The date_default_timezone_set() function sets the default timezone used by all date/time functions in the script.
US' Default Time Zone Unfortunately, there is no default time, so you have to change your time depending on the time zone used in the place.
Considering you use apache from the fact you mention .htaccess:
Yes, as long as it runs mod_php it is possible in .htaccess like so:
php_value date.timezone "Europe/Berlin"
Or you could set date.timezone in php.ini like Karl Laurentius Roos suggested. This would only be possible if you have access to your php config through. Remember to restart PHP (CGI mode) or your webserver (mod_php) after altering php.ini.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With