Last modified: 2009-02-04 14:23:23 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 T19346, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17346 - #time gives wrong year if only year prior to 1960 is given
#time gives wrong year if only year prior to 1960 is given
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-04 07:18 UTC by J JMesserly
Modified: 2009-02-04 14:23 UTC (History)
4 users (show)

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


Attachments

Description J JMesserly 2009-02-04 07:18:16 UTC
for version 1.15alpha (r46424)

correct:{{#time:Y|1960}} gives 1960
bug:{{#time:Y|1959}} gives 2009
Comment 1 Splarka 2009-02-04 07:28:28 UTC
Expected in strtotime()

http://uk3.php.net/manual/en/function.strtotime.php

A four-digit number is interpreted as hours and minutes if possible, and otherwise as year. 1959 is a valid time, 1960 isn't. 

It just needs more data than a 4 digit number.
Comment 2 Niklas Laxström 2009-02-04 07:43:48 UTC

*** This bug has been marked as a duplicate of bug 11686 ***
Comment 3 Brad Jorsch 2009-02-04 14:22:18 UTC
Actually, it has nothing to do with bug 11686. Since it is functioning as documented at [[mw:Help:Extension:ParserFunctions]], I'm marking it "Invalid" instead.

BTW, a workaround is to simply specify a (dummy) month and day along with the year, e.g. {{#time:Y|1959-02-02}} works as expected. Avoid "-01-01" unless your PHP default timezone is UTC, see bug 17080.
Comment 4 Roan Kattouw 2009-02-04 14:23:23 UTC
(In reply to comment #3)
> Avoid "-01-01" unless your
> PHP default timezone is UTC, see bug 17080.
> 
Or just use -01-02, which is guaranteed to be in 1959 in any timezone.

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


Navigation
Links