Last modified: 2014-06-23 16:07:04 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 T56676, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54676 - #timel:t returns wrong number of days if date argument is first day of month with 30 or 28 days
#timel:t returns wrong number of days if date argument is first day of month ...
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.21.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-27 02:58 UTC by Lucas
Modified: 2014-06-23 16:07 UTC (History)
1 user (show)

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


Attachments

Description Lucas 2013-09-27 02:58:45 UTC
After an upgrade from 1.18.1 to 1.21.2 noticed some of my templates were broken. In troubleshooting them, discovered weird behaviour of timel:t where it wouldn't return the right number of days in a month if the date argument was the first day of a month with 30 or 28 days in it. #time: showed no such behaviour. Maybe something I'm doing wrong. Couldn't find a bug like it. 

example output:

{{#timel:t|2013-01-01}} ▷ 31
{{#timel:t|2013-02-10}} ▷ 28
{{#timel:t|2013-02-01}} ▷ 
{{#timel:t|2013-Feb}} ▷ 31
Comment 1 Lucas 2013-09-27 03:00:15 UTC
sorry, that 3rd example is:

{{#timel:t|2013-02-01}} ▷ 31
Comment 2 Bartosz Dziewoński 2013-09-27 11:56:47 UTC
Why are you using #timel? It's using your wiki's timezone, and it might turn out that 2013-02-01 (UTC) is 2013-01-31 (your local timeze), which has 31 days.
I would bet that is the case.
Comment 3 Brion Vibber 2013-09-30 10:38:02 UTC
Analysis in comment 2 sounds about right -- go ahead and use #time instead of #timel here and your problem should be fixed.

(Basically, remember that the input timestamp always carries a time as well as a date, and *that* is in UTC/GMT timezone: when you say '2013-02-01' you actually are telling it '2013-02-01 00:00:00 UTC'. #timel shifts that time to your local timezone, which might be say '2013-01-31 19:00:00 UTC-0500' for EST... so you end up calculating the days-in-month for the local month, January.)
Comment 4 Lucas 2013-09-30 13:07:52 UTC
Ah. Yes. I see. 

Supplying a date of 2013-02 really resolves to 2013-02-01 00:00:00. Asking timel to do anything with it implies that the argument supplied is UTC.

The behavior changing from 1.18.1. threw me. It's behaving MORE consistent with it's intent.

I'll let the next one stew longer before running to mommy.

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


Navigation
Links