--- title: "How to: Change Timezone in PHP" slug: "how-to-change-timezone-in-php" updated: 2026-07-01T01:44:11Z published: 2026-07-01T01:44:11Z canonical: "docs.serversaustralia.com.au/how-to-change-timezone-in-php" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.serversaustralia.com.au/llms.txt > Use this file to discover all available pages before exploring further. # How to: Change Timezone in PHP Most servers have a set timezone. Sometimes you will want a website or php scripts to run at a completely different timezone. This is how you would change the timezone for php. ## For shared hosting: In shared hosting, you won't have access to change the server's timezone, because this can affect other users. Therefore, you can only do so by placing a php.ini file in your website's public_html. You can use an FTP program to upload a php.ini or use the cPanel file editor utility in File Manager. Create a file called *php.ini* in the document root of the website and edit the php.ini. In the php.ini file add the following value: ```plaintext date.timezone="Australia/Sydney" ``` *This will set the timezone to Sydney.* > [!NOTE] > Here's a list of available options for Australia: [http://php.net/manual/en/timezones.australia.php](http://php.net/manual/en/timezones.australia.php) If you want to use a timezone for just a single script, instead of in general. You would do so by adding the below to your code: ```plaintext ``` ## **For a virtual or dedicated server:** When you have your own server and want to change the PHP timezone for the entire server, you can do so by simply changing the timezone in the server's php.ini. On a cPanel server, it's located at**:** ```shell /usr/local/lib/php.ini ``` In that file, you'd place*:* ```shell date.timezone="Australia/Sydney" ```