To set the server time in PHP you can use the following snippet.
It required PHP 5.1.0 or higher.

Sample PHP


for more informations see: date_default_timezone_set and for a list of possible Timezones List of Supported Timezones

2 thought on “How to set the server time in PHP”

Leave a Reply