Last modified: 2013-11-01 23:59:49 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T18847, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16847 - {{#time}} gives incorrect result if server not set to UTC.
{{#time}} gives incorrect result if server not set to UTC.
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-31 03:39 UTC by David Batley
Modified: 2013-11-01 23:59 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description David Batley 2008-12-31 03:39:36 UTC
On a server set to a non-UTC time zone, the #time function gives odd results.

Server set to PST (UTC -8):
{{#time: j F Y H:i | 2008-12-24 12:01:29    }} is rendered as "24 December 2008 20:01"
{{#time: j F Y H:i | 2008-12-24 12:01:29+00 }} is rendered as "24 December 2008 12:01"
{{#time: j F Y H:i | 2008-12-24 12:01:29+01 }} is rendered as "24 December 2008 11:01"

The result is always rendered in UTC, regardless of what the input or server time is set to. And if no time zone is set, the time zone php is set to is used (I think this is the fault of PHP's strtotime function).

This gives a highly confusing situation where rendering a time gives a different time. This could also cause some very subtle errors (eg: a wiki set to London time would be wrong half the year only).

My workaround was to set
  date_default_timezone_set("UTC");
in LocalSettings.php.
Comment 1 Chad H. 2009-09-09 13:44:25 UTC
Possible dupe to 17080?
Comment 2 Ryan Kaldari 2013-11-01 23:59:49 UTC
This seems to be working now. Was probably a dupe of bug 17080.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links