Page MenuHomePhabricator

Timezone of Windows/XAMPP server not set as default for users
Closed, DeclinedPublic



I am using a Windows server with XAMPP to host MediaWiki 1.23.2. The Windows machine is set to "Europe/Berlin" timezone (UTC+2 currently due to DST).

When I go at 15:12 (local time, DST) to the preferences of a user I get shown the following:
Server time: 13:12
Local time: 13:12
Time zone: Other (specifiy offset)
(empty field for offset)
This is in both cases the UTC time.

I tried to set the wgLocaltimezone, but it seems to already be set correctly!?

If I add (to e.g. LocalSettings.php):
print("$wgLocaltimezone: ");
print $wgLocaltimezone;
print(", $wgLocalTZoffset: ");
print $wgLocalTZoffset;
then I see "Europe/Berlin" as wgLocaltimezone, and wgLocalTZoffset is already set to 120.

I would like to (simply?) change the setup so every user has by default the Europe/Berlin timezone.

Version: 1.23.2
Severity: normal
Platform: PC



Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:27 AM
bzimport set Reference to bz70032.
bzimport added a subscriber: Unknown Object (MLST).

Thanks for taking the time to report this!

Which Windows version is this about, and which PHP version?

Is the output of

date('Z') / 60;

also 120, as described in$wgLocalTZoffset (wondering on which level the issue happens)? wrote:

OK, I made one mistake in the bug-description: The debug output needs to be at the end of Setup.php to output the values as above. (I moved the code to LocalSettings.php, but forgot the comment out in Setup.php)

Beginning of Setup.php (or beginning of LocalSettings.php):

  • wgLocaltimezone is empty
  • wgLocalTZoffset is empty
  • date('Z') / 60 is "120"

End of Setup.php

  • wgLocaltimezone is "Europe/Berlin"
  • wgLocalTZoffset is "120"
  • date('Z') / 60 is "120"

Tested this both on Windows 7 SP1 and Windows Server 2012 Standard.

PHP is PHP/5.5.11 wrote:

One more thing:
PHP/5.5.6 on Windows Server 2012

  • and -

PHP/5.5.11 on Windows 7 SP1

Are you setting $wgLocalTimezone or $wgLocalTZoffset in your LocalSettings.php or are you setting them by hand? (Those values are picked from php.ini or whatever PHP guesses to be correct for the platform...)

@Aklapper Could we somehow notify "Tony Mach" from Bugzilla about this bug?

@Aklapper Could we somehow notify "Tony Mach" from Bugzilla about this bug?

I would not know how... Bugzilla accounts were tied to email addresses and users received several emails about the migration to Phabricator before we migrated. If users did not act on emails I assume they were not interested or didn't check their mail account. Maybe this is user Tony_Mach on en.wp?

@Aklapper yep, all is well, I got an answer: Interesting info about bugzilla migration!

I'd need the following information:

  1. the output of the w32tm /tz command on the server and on the Windows client
  2. if the client is UNIX-like, what does the date say and where /etc/timezone is linked to, whether $TZ is set in the environment
  3. try to invoke <?php phpinfo(); via HTTP on your server and please not your server's php.ini location
  4. try to run php -c c:\path\to\your\php.ini -i and identify date section.
  5. try to get output of <?php var_dump(ini_get('date.timezone')); via HTTP or by running php -c c:\path\to\your\php.ini

At my place it looks like this:


date/time support => enabled
"Olson" Timezone Database Version => 2015.4
Timezone Database => internal
Default timezone => Europe/Warsaw

Directive => Local Value => Master Value
date.default_latitude => 31.7667 => 31.7667
date.default_longitude => 35.2333 => 35.2333
date.sunrise_zenith => 90.583333 => 90.583333
date.sunset_zenith => 90.583333 => 90.583333
date.timezone => Europe/Warsaw => Europe/Warsaw

When I try PHP CLI without giving it a configuration file I get

` $ php                                   
<?php var_dump(ini_get('date.timezone'));
string(0) ""

(additionally one might get a warning as well)

` $ php -c /etc/php/apache2-php5.6/php.ini           
<?php var_dump(ini_get('date.timezone'));
string(13) "Europe/Warsaw"

so it is easy to get a wrong information without or with a wrong php.ini file.

Do you set $wgLocaltimezone in your LocalSettings.php explicitly? If not, does it help if you do?

Aklapper changed the task status from Open to Stalled.Nov 8 2020, 11:19 AM

@TonyMach: Could you please answer the last comment? Thanks in advance!

Unfortunately closing this Phabricator task as no further information has been provided. After you have provided the information asked for and if this still happens, please set the status of this task back to "Open" via the Add Action...Change Status dropdown. Thanks!