PHP - How to set the timezone? | Sololearn: Learn to code for FREE!
+ 2

PHP - How to set the timezone?

Hi, I have written a PHP code for messages for each day. The main part needs the timezone to display the correct day. For my code, I have set it like this: // Time zone for right time date_default_timezone_set('Asia/Dubai'); But as you can see, this is set to Asia timezone. Ppl in the USA or UK will not get the right message for the day. So how do I fix this timezone so that no matter which server location you are at, the time of day is right. Thanx for reading

18th Apr 2018, 8:11 AM
2 ответов
+ 2
It's OK, Dubai is in Asia ( You can try with the "Australia/Sydney" timezone to check the impact. For me it works. For info, here the list of timezones:
18th Apr 2018, 2:59 PM
Thank u Jerome.
18th Apr 2018, 5:18 PM