{"id":1598,"date":"2019-02-08T10:35:53","date_gmt":"2019-02-08T10:35:53","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2019\/02\/08\/1583192-how-to-change-the-php-timezone-setting-for-your-website-in-hostinger\/"},"modified":"2026-03-16T12:12:18","modified_gmt":"2026-03-16T12:12:18","slug":"1583192-how-to-change-the-php-timezone-setting-for-your-website-in-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/1583192-how-to-change-the-php-timezone-setting-for-your-website-in-hostinger\/","title":{"rendered":"How to Change the PHP Timezone Setting for Your Website in Hostinger"},"content":{"rendered":"<p class=\"no-margin\">While your <b><a class=\"intercom-content-link\" href=\"\/support\/1583329-what-is-the-timezone-of-your-servers\" target=\"_blank\" rel=\"noopener\">server&rsquo;s global time configuration<\/a><\/b> <b>cannot be changed<\/b>, you still can set the timezone for your website using <b><a class=\"intercom-content-link\" href=\"#h_34b97b2803\" target=\"_blank\" rel=\"noopener\">hPanel<\/a> <\/b>or the <b><a class=\"intercom-content-link\" href=\"#h_82758bce72\" target=\"_blank\" rel=\"noopener\">PHP function<\/a><\/b>:<\/p><h2 id=\"h_34b97b2803\">Setting up Timezone via hPanel<\/h2><p class=\"no-margin\">Open <b><a class=\"intercom-content-link\" href=\"https:\/\/hpanel.hostinger.com\/websites\" target=\"_blank\" rel=\"noopener\">Websites<\/a> &rarr; Dashboard <\/b>&rarr; <b>PHP Configuration <\/b>page. There, open the <b>PHP options<\/b> tab and edit the <b>date.timezone <\/b>value:<\/p><div class=\"intercom-container\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2019\/02\/55a9e26b-c9b1-4d1d-a46c-97dd0a6df8cc.jpg\"><\/div><p class=\"no-margin\">If you are not sure which time zone to insert, check the <b><a class=\"intercom-content-link\" href=\"https:\/\/www.timeanddate.com\/time\/map\/\" target=\"_blank\" rel=\"noopener\">Time Zone Map<\/a><\/b>.<\/p><p class=\"no-margin\">Save the changes at the bottom of the page, and the timezone will be updated &#128640;<\/p><h2 id=\"h_82758bce72\">Setting up Timezone via PHP Function<\/h2><p class=\"no-margin\">As an alternative, you can set the timezone using the<b> date_default_timezone_set<\/b> PHP function. Just check the <b><a class=\"intercom-content-link\" href=\"https:\/\/www.php.net\/manual\/en\/timezones.php\" target=\"_blank\" rel=\"noopener\">List of Supported Timezones<\/a><\/b>, find the one which you need, and insert the following code to your website (in most cases, on your <b>index.php <\/b>file):<\/p><pre><code>&lt;?php\r\ndate_default_timezone_set(\"Asia\/Bangkok\");\r\necho date_default_timezone_get();\r\n?&gt;<\/code><\/pre><p class=\"no-margin\">Replacing &ldquo;Asia\/Bangkok&rdquo; with the desired timezone.<\/p><p class=\"no-margin\"><b>Additional Resources<\/b><\/p><ul>\n<li>\n<p class=\"no-margin\"><b><a class=\"intercom-content-link\" href=\"\/support\/4605619-how-to-change-the-database-timezone-on-phpmyadmin\" target=\"_blank\" rel=\"noopener\">How to Change the Database Timezone on phpMyAdmin Session<\/a><\/b><\/p>\n<\/li>\n<li>\n<p class=\"no-margin\"><b><a class=\"intercom-content-link\" href=\"https:\/\/www.php.net\/manual\/en\/function.date-default-timezone-set.php\" target=\"_blank\" rel=\"noopener\">PHP documentation on the date_default_timezone_set function<\/a><\/b><\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Setting a different timezone with hPanel and PHP function<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[230],"tags":[],"class_list":["post-1598","post","type-post","status-publish","format-standard","hentry","category-php-advanced"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/1583192-how-to-change-the-php-timezone-setting-for-your-website-in-hostinger\/","default":1},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/support\/1583192-como-modificar-la-configuracion-de-zona-horaria-de-php-para-tu-sitio-web-en-hostinger\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/support\/1583192-comment-puis-je-modifier-le-parametre-de-fuseau-horaire-de-php-pour-mon-site-web-hostinger\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/support\/1583192-bagaimana-cara-memodifikasi-pengaturan-php-timezone-untuk-website-saya-di-hostinger\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/br\/support\/1583192-como-alterar-a-configuracao-de-fuso-horario-do-php-para-o-seu-site-hostinger\/","default":0},{"locale":"uk-UA","link":"https:\/\/www.hostinger.com\/ua\/support\/1583192-----\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1598","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=1598"}],"version-history":[{"count":2,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1598\/revisions"}],"predecessor-version":[{"id":8075,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1598\/revisions\/8075"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=1598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=1598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=1598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}