Last modified: 2014-11-18 18:07:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
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)
All All
: Normal enhancement with 5 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  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: ---


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
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

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

(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.