How to set the server time in PHP

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

Sample PHP

date_default_timezone_set('Europe/Berlin');

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

Please Share us:
Please rate this snippet

2 thoughts on “How to set the server time in PHP

Leave a Reply