Windows PHP Does Not Handle Time Zones Correctly

1 minute readTroubleshooting

Description

PHP does not handle certain operating system time zones correctly on a Windows system. If the web server is running on a machine set for one of these time zones, users connected to that web server will see all times displayed as UTC times, instead of the web server time zone.

Workaround

In the config.php file, you must explicitly set the PHP “timezone_identifier”.

To set the timezone:

  1. Edit the following file.

C:\Program Files\CloudBees\Software Delivery Automation\apache\htdocs\commander\config.php
  1. Add the following line anywhere between the opening and closing PHP tags:

date_default_timezone_set("<timezone_identifier>");

For example:

To set the timezone for Taipei, you would add:

date_default_timezone_set("Asia/Taipei");

For a complete list of supported time zones, select link:https://www.php.net/manual/en/timezones.phphere.