{"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-10-29T15:09:17","modified_gmt":"2026-10-29T15:09:17","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\">Change the PHP timezone setting for your website in Hostinger by editing the date.timezone value on the PHP Configuration page, or by adding the <code>date_default_timezone_set<\/code> PHP function to your website code. The server&rsquo;s global time configuration can&rsquo;t be changed.<\/p><h2 id=\"h_34b97b2803\">Setting up timezone via Hostinger dashboard<\/h2><p class=\"no-margin\">Open <b><a data-click-id=\"hgr-post-content-link-websites\" class=\"intercom-content-link\" href=\"https:\/\/hpanel.hostinger.com\/websites\" target=\"_blank\" rel=\"noopener\">Websites<\/a> &rarr; Manage site <\/b>&rarr; <b>PHP Configuration <\/b>page. There, open the <b>PHP options<\/b> tab and <a data-click-id=\"hgr-post-content-link-edit-the-date-timezone-value\" href=\"\/support\/4622479-how-to-change-values-of-php-parameters-in-hostinger\/\">edit the <b>date.timezone <\/b>value<\/a>:<\/p><div class=\"intercom-container\"><img decoding=\"async\" class=\"alignnone size-full wp-image-20740\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2026\/10\/2026-10-15_16-03.png\/public\" alt=\"\" width=\"1219\" height=\"714\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2026\/10\/2026-10-15_16-03.png\/w=1219,fit=scale-down 1219w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2026\/10\/2026-10-15_16-03.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2026\/10\/2026-10-15_16-03.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2026\/10\/2026-10-15_16-03.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1219px) 100vw, 1219px\" \/><\/div><p class=\"no-margin\">If you are not sure which time zone to insert, check the <b><a data-click-id=\"hgr-post-content-link-time-zone-map\" 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.<\/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 data-click-id=\"hgr-post-content-link-list-of-supported-timezones\" 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>Your website now uses the timezone you set, while the server&rsquo;s global time stays unchanged.<\/p><p class=\"no-margin\"><b>Additional resources<\/b><\/p><ul>\n<li>\n<p class=\"no-margin\"><b><a data-click-id=\"hgr-post-content-link-how-to-change-the-database-timezone-on-phpmyadmin-session\" class=\"intercom-content-link\" href=\"\/support\/4605619-how-to-change-the-database-timezone-on-phpmyadmin-at-hostinger\/\" 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 data-click-id=\"hgr-post-content-link-php-documentation-on-the-date_default_timezone_set-function\" 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>Change the PHP timezone setting for your website in Hostinger by editing date.timezone in PHP Configuration or using date_default_timezone_set.<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_content_updated_date":"","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-BR","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-\u044f\u043a-\u0437\u043c\u0456\u043d\u0438\u0442\u0438-\u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f-\u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e-\u043f\u043e","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":7,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1598\/revisions"}],"predecessor-version":[{"id":23465,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1598\/revisions\/23465"}],"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}]}}