Jump to content

How does PHP know a TimeZone?


JREAM

Recommended Posts

I cant figure out which is which here.

 

You can mktime() and date() and microtime() and time(),

Are these all configured in GMT standards?

 

When you install a PHP script how do they know what your timezone is? Is there a way to automatically identify the Hardware or web Server or something?

Link to comment
https://forums.phpfreaks.com/topic/165940-how-does-php-know-a-timezone/
Share on other sites

When you install a PHP script how do they know what your timezone is

By magic! No, your server's settings are used. Change the timezone on your sever if required. If you cannot do this then php has functions to display the correct time for your locale.

There are also a few function available to PHP for you to look at, however I would suggest setting it at the server level to to GMT 0, so it is stored in your database at a neutral time, then use PHP to display different timezones for the users. Not required, but can make it easier incase you change server locations etc.

 

http://us3.php.net/manual-lookup.php?pattern=timezone&lang=en

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.