How can I get the local server's time zone?
问题 How can I get the local server's timezone without relying on php.ini or other configuration files? I am looking for an output similar to the output of date('e'). eg. "UTC", "GMT", or "Atlantic/Azores". I need to know this so that I may know the MySQL timezone. 回答1: If you're using a Linux/Unix based hosting platform, you could use the output of the date command with the "alphabetic time zone abbreviation" formatter as such: $systemTimeZone = system('date +%Z'); However, it should be noted