How to change the timezone for a single PHP file?

You can set a specific timezone for a PHP script using the following function which should be added to the PHP file:

putenv("TZ=US/Central");

This is just an example. You should simply replace "US/Central" with the desired timezone.

you can also change the PHP timezone on a per-folder basis

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Can I use cURL with my account?

Yes, all of our servers have cURL enabled. The path to cURL is /usr/bin/curl .

Do you support Python?

Yes, we do. The path to Python is /usr/bin/python .

What is Perl?

Perl stands for 'Practical Extraction and Reporting Language'. Perl is a versatile programming...

What permissions should I run my Cgi scripts under?

All CGI scripts should be placed in the CGI-BIN and set to chmod 755.

Do you support installation and use of PHPBB?

We have one touch installs for XMB, PHPBB, and Invisionboard. Here are some links to some...