KNOWLEDGEBASE · LINUX
PHP: Setting custom local time zone by PHP time offset
Last updated 2020-04-02
Server default time zone is CST, that is GMT-0600 currently. The time runs off the system-time, not account-time.
You can setup an offset from the server-time to your local-time, in the PHP scripts in your account, such that they display you local-time on browser outputs. One method of doing the same is to enter the following command in your scripts .htaccess to enable scripts to show local time zone for example
SetEnv TZ CDT-5:30
SetEnv TZ America/Indianapolis
For a list of valid options (time zone) goto http://in.php.net/manual/en/timezones.php
You can setup an offset from the server-time to your local-time, in the PHP scripts in your account, such that they display you local-time on browser outputs. One method of doing the same is to enter the following command in your scripts .htaccess to enable scripts to show local time zone for example
SetEnv TZ CDT-5:30
SetEnv TZ America/Indianapolis
For a list of valid options (time zone) goto http://in.php.net/manual/en/timezones.php
Tell us what has to stay up.
A short conversation with an engineer. No quote-bot, no callback queue. We'll tell you honestly if we're not the right fit.