Last modified: 2014-11-18 18:07:18 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 T7733, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 5733 - Add {{CURRENTHOUR}} and {{CURRENTMINUTE}} magic words
Add {{CURRENTHOUR}} and {{CURRENTMINUTE}} magic words
Status: CLOSED DUPLICATE of bug 7116
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal enhancement with 5 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-27 08:55 UTC by Tisza Gergő
Modified: 2014-11-18 18:07 UTC (History)
1 user (show)

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


Attachments

Description Tisza Gergő 2006-04-27 08:55:00 UTC
{{CURRENTTIME}} is the only time-related magic word that returns a string
instead of a number. Because of that, it is incompatible with parser functions.
Having {{CURRENTHOUR}} and {{CURRENTMINUTE}} would solve that, and make time
zone handling templates possible without having to resort to perversions like
http://en.wikipedia.org/w/index.php?title=User:Ed_Poor/hour&action=edit
Comment 1 Rob Church 2006-04-27 12:52:15 UTC
You realise that {{CURRENTMINUTE}}, in particular, would be subject to being
cached quite significantly?
Comment 2 Tisza Gergő 2006-04-27 13:37:12 UTC
How is that different from {{CURRENTTIME}}?
Comment 3 Melancholie 2006-04-28 03:59:44 UTC
See also: Bug 366 comment #11 and bug 366 comment #12 (workaround used on fr.wp)
Comment 4 Rob Church 2006-05-03 07:00:44 UTC
(In reply to comment #2)
> How is that different from {{CURRENTTIME}}?

{{CURRENTTIME}}, at least, has other elements in output which make it
semi-useful, cached or no. Adding a magic word which we know will be rendered
out of date via caching seems a little stupid to me.
Comment 5 Tisza Gergő 2006-05-05 16:37:49 UTC
(In reply to comment #4)
> {{CURRENTTIME}}, at least, has other elements in output which make it
> semi-useful, cached or no. Adding a magic word which we know will be rendered
> out of date via caching seems a little stupid to me.

The functionality of {{CURRENTHOUR}} + {{CURRENTMINUTE}} would be a superset of
that of {{CURRENTTIME}}. You can think they all are stupid, but that doesnt
change the fact that people use them. And right now, timezone arithmetics are
done through ugly and inefficient hacks (I wouldnt use the term "workaround" for
a template with 1000+ rows just to increment the hour by one). Cutting the time
to numeric parts which can be passed to the parser functions would be certainly
less stupid than that.
Comment 6 Darkoneko 2006-05-30 14:15:10 UTC
a switch with 60*24 possibilities (1440, one per minute of the day) must be a
real ly server-draining, isn't it ?
Comment 7 Raimond Spekking 2006-08-23 16:51:43 UTC
{{CURRENTHOUR}} introduced in r16058 by Tim Starling
Comment 8 bdk 2006-08-23 17:55:25 UTC
reopened, {{CURRENTMINUTE}} is also an issue of this bug and is not implemented yet
Comment 9 Rob Church 2006-08-23 23:47:55 UTC
{{CURRENTMINUTE}} would be worthless if implemented, due to caching. Therefore,
there's little to no point in implementing it.
Comment 10 Raimond Spekking 2006-08-24 11:41:02 UTC
For understanding purposes: What is the difference in caching between existing
{{CURRENTTIME}}, {{CURRENTTIMESTAMP}} (incl. seconds!) and the requested
{{CURRENTMINUTE}}?

And the folks are very creativ, see [[en:Template:CURRENTMINUTE]] and
[[de:Template:CURRENTMINUTE]] ;-) Which method is more expensive?
Comment 11 Rob Church 2006-08-24 11:53:15 UTC
CURRENTTIME and CURRENTTIMESTAMP are also used for substitution; other
information comes out of those variables which is not so adversely affected by
caching.

(sigh) And it's resorted to "threatening" us with "expensive" templates?
Describe an example of use of a CURRENTMINUTE magic word where caching isn't an
issue, aside from substitution.
Comment 12 Tim Starling 2006-08-24 11:57:52 UTC
Introuducing hundreds of different magic words for time is a waste of time. We 
should just introduce a {{#time}} function which does everything, see my comment 
on bug 7114. {{CURRENTMINUTE}} would simply be {{#time:i}}. {{CURRENTHOUR}} would 
be {{#time:H}}. 
Comment 13 Rob Church 2006-08-24 12:03:25 UTC
That would be the best solution; it stops us filling up our codebase with
useless junk, and if the users want to "dynamically" use {{#time:i}}, they can
waste their time with it.
Comment 14 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-24 13:58:48 UTC

*** This bug has been marked as a duplicate of 7116 ***
Comment 15 Sebastian Moleski 2006-08-27 17:41:52 UTC
{{#time:}} has been implemented and should cover all scenarios discussed herein.
Caching will still invalidate many instances where this function would be useful.

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


Navigation
Links