Site5 - Built For Designers & Developers MENU
Home  ›  PHP  ›  PHP: Set or change a websites timezone using .user.ini

PHP: Set or change a websites timezone using .user.ini

7 Comments

You can change the default timezone by using a custom .user.ini. Below are the steps needed to set this up.

1) You will first need to login to the account using SSH. Alternatively, you can use File Manager in your control panel.

2) Next, create a .user.ini file our public_html directory. For more information on how to do this, please see this article.

3) Now that the .user.ini file has been created, you would need to add the following line to the .user.ini file:

date.timezone=TIMEZONE

Make sure to replace “TIMEZONE” with the specific timezone you are trying to set this to such as, “Canada/Eastern”, “Europe/London”, “Asia/Delhi”, etc.

And that’s it! you’ve now set the time zone that your sites will use.

Still have a question? Or need help?
If you need technical support with your account, please email us or chat live with a representative.

7 Comments

  • ;date.timezone = “Asia/Calcutta”
    was done in the php.ini file but still the announcement platform at http://www.tellall.in/pieces does not produce the correct output in terms of date.
    :-(

    • Hi Sandeep

      There could be many other reasons why the timezone is not showing up correctly. It could also be set within your database. Please contact our support team via Backstage, and we’d be happy to take a look!

    • sandeep try this without ; in the begining.
      date.timezone = “Asia/Calcutta”

      • also retype the double quotes, this comment form is converting the double quotes to another set of ascii double quotes which is not supported by programming language like php.

  • how to implement this with UTC timezone? is it
    date.timezone = UTC”

  • I was told that physically our server is located in Dallas and unfortunately Site5 does not change server default time zone on managed servers. Server time zone is always bound to server’s geographical location and this means our VPS time zone will remain CDT (UTC-5).

    We are integrating Cybersource payment gateway to our ecommerce website and Cybersource requires that our server timezone must be set to UTC date & format. How do we implement this?

    Please help.

    • Hello,

      Yes, the timezone on a managed service will always be tied to the physical location, and we cannot change that. If a change to the time format is absolutely required, then an unmanaged VPS will be required – http://www.site5.com/vps/unmanaged/

Money Back Guarantees