Limited Time Offer - from ₹45.00/month
00
DAYS
07
HOURS
40
MINUTES
33
SECONDS
Get Started
×

Hostinger's Knowledge Base

Find articles and information about features, various troubleshooting guides,
and other technical information related to the Hostinger's services

How can I modify the PHP timezone setting for my website?

Modified on:
timezone php php timezone

Your server's Global time configuration cannot be changed, but you can use the PHP function date_default_timezone_set to set the timezone for your website. Here's an example code that sets and checks the currently set timezone:

<?php
date_default_timezone_set("Asia/Bangkok");
echo date_default_timezone_get();
?>

A list of available PHP timezones can be found here: http://www.php.net/manual/en/timezones.php

  • Easy Website Builder
  • 99.9% Uptime Guarantee
  • 24/7 Live Support
  • Powerful Control Panel
  • 30-Days Money-Back Guarantee
Limited Time Special Offer!
From
45
00
/mo
Save 90%
Get started