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

  • Ubegrenset antall nettsider
  • 24/7 Live Støtte
  • Enkel Nettsted Bygger
  • 2X WordPress optimalisert hastighet
  • 30-dagers Tilbakebetalingsgaranti
Ta tak i begrenset tidsavtale!
kr 19
99
/mo
kr209,97
kr59,97 i 3 måneder
Lagre 71%
Kom i gang