Setting Timezones in PHP

All servers on Stablepoint are set so their localization settings are set to UTC. This ensures consistency across all servers and means that timezones are not preferential to any particular user or group of users. This means, if you'd like to reflect dates or timezones with respect to a locale, you have to set that within your application itself.

To set a timezone in PHP, you can use the following line in your code:-


For example will set the timezone to London. This means that any dates or times will be expressed with respect to London's timezone, taking account of British Summer Time and other changes in time throughout the year.

Did this page help you?