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

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

  • configuration, timezone, website, date_default_timezone_set, PHP
  • 0 Los Usuarios han Encontrado Esto Útil
¿Fue útil la respuesta?

Artículos Relacionados

Is allow_url_fopen enabled on your servers?

PHP function allow_url_fopen is enabled on all of our Shared Hosting packages. 

Do you support GCC compiler?

GCC compilers are not supported on Ultahost.com our servers. You can still install it on our VPS...

PHP Fatal error: Cannot redeclare

If you see error message 'PHP Fatal error: Cannot redeclare function' or similar error message in...

How to turn off PHP error reporting?

To turn off PHP error reporting you can use the following snippet in your PHP script:...

I get 'unexpected T_STRING' error

You may get this error because all .html files are parsed as PHP here. So, if your .html file...