Template talk:TODAY
Add topic| This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||
| ||||||||
| This template was considered for deletion on 2016 September 4. The result of the discussion was keep. |
| This template was considered for deletion on 27 November 2021. The result of the discussion was keep. |
Subst does not work
[edit]Hi.
Contrary to what the documentation pages says, Subst in this code snippet does not work:
<ref>{{cite web |accessdate={{Subst:TODAY}} |title=Languages |work=Apache HTTP Server |agency=Ohloh |publisher= Black Duck Software |url=https://www.ohloh.net/p/apache/analyses/latest/languages_summary}}</ref>
{{Reflist}}
Result:
- ↑ "Languages". Apache HTTP Server. Black Duck Software. Ohloh. Retrieved {{Subst:TODAY}}.
{{cite web}}: Check date values in:|accessdate=(help)
Screenshot:
Why is that?
Best regards,
Codename Lisa (talk) 23:41, 1 April 2014 (UTC)
- Codename Lisa, subst doesn't work inside of references. A workaround is to replace the
<ref>...</ref>with {{subst:#tag|ref| }} and then substitute everything at the same time.
- Is there a reason why it doesn't work? Would it be possible to change that so it does? Algotr (talk) 17:19, 5 September 2022 (UTC)
Date in other calendars not documented?
[edit]| Today |
|
[] |
I found the template used like this {{Today/AD/SH/AH}} (see effect right and yes, / not |) to show today's date in various calendars (Common Era, Islamic calendar, Solar Hijri calendar). But this usage is not documented? Should I really be looking for the template for a US TV show? [how was that allowed to happen!]. --John Maynard Friedman (talk) 12:11, 8 January 2019 (UTC)
- My mistake. Template:Today/AD/SH/AH and template:Today/AD/AH are independent templates that just happen to begin with the word "today". The / marks are not delimiters like the | symbol. --John Maynard Friedman (talk) 00:24, 10 January 2019 (UTC)
Supporting different/multiple calendars' dates for today
[edit]In addition to {{TODAY}}, we also have:
{{Today/AD/AH}}, {{Today/AD/SH/AH}}, {{Today/BS/AH/AD}}, {{Today/CE/AM}}.
Can these be consolidated into {{TODAY}} and deprecated?
And what about all the other calendars?
Gregorian calendar has a long list: Gregorian calendar, Ab urbe condita, Armenian calendar, Assyrian calendar, Bahá'í calendar, Balinese saka calendar, Bengali calendar, Berber calendar, British Regnal year, Buddhist calendar, Burmese calendar, Byzantine calendar, Chinese calendar, Coptic calendar, Discordian calendar, Ethiopian calendar, Hebrew calendar, Hindu calendars (Vikram Samvat, Shaka Samvat, Kali Yuga), Holocene calendar, Igbo calendar, Iranian calendar, Islamic calendar, Japanese calendar, Javanese calendar, Juche calendar, Julian calendar, Korean calendar, Minguo calendar, Nanakshahi calendar, Thai solar calendar, Tibetan calendar.
It seems like it would be great if we had a comprehensive {{TODAY}} that allowed for selection of inclusion of dates from any of these calendars, since they are described and used for their year designations (e.g., on Gregorian calendar and year pages like 2019) already.
Add a purge button?
[edit]Ref. this report at Talk:Anno Domini#Error in the "Today" infobox:
There is an error in the "Today" infobox. At 00:42 2 Feb 2026 UTC (which I confirmed by making a test edit in WP:Sandbox), the infobox was saying that in the Gregorian calendar it was Saturday 31 January 2026 (and it is still saying the same an hour later). ~2025-33904-40 (talk) 01:10, 2 February 2026 (UTC)
- Plus, I went into "Hebrew calendar" which also has a "Today" infobox near the top, and that one is saying (as of about 5 minutes ago), that the Gregorian date "at UTC+00" is Friday 30 January 2026. ~2025-33904-40 (talk) 02:48, 2 February 2026 (UTC)
- "Due to MediaWiki and browser caching, these variables frequently show when the page was cached rather than the current time" – https://www.mediawiki.org/wiki/Help:Magic_words#Date_and_time .
Would there be any point in adding a {{purge}}? (would it have any effect on MediaWiki?) [btw, I was mistaken to believe that this template originally had a purge button. It must have been one of the templates that were replaced by this one.] 𝕁𝕄𝔽 (talk) 20:32, 2 February 2026 (UTC)
- @JMF: For example {{time}} has a purge button by default. I would say templates like {{time}} are more about presentation, are more customisable like formatting and time zones, and even may return linked text. Such presentation templates including {{Infobox calendar date today}} can have (optional) purge button. The infoboxes in many "date and time notation" articles like Date and time notation in Japan or Republic of China calendar also have refresh buttons.
- While this {{TODAY}} or e.g. {{yesterday}}, {{monthyear}}, {{CURRENTTIME}}, {{DATE}} output in strict and specific formats, return plain texts, and may be used for further template operations or to generate page names (Wikipedia:Today's featured article/August 7, 2026). Then including a purge button in this stage would not be helpful. — Peterwhy (talk) 19:59, 17 February 2026 (UTC)
- I'm afraid I don't follow your explanation but that doesn't matter really so long as there is a plan to resolve the issue? 𝕁𝕄𝔽 (talk) 00:12, 18 February 2026 (UTC)
- I don't think {{TODAY}} will add a purge button, because it was designed to return a plain text of just DMY. This is so that other templates can still accept the result of {{TODAY}} and work. Alternatively, one can add a purge button to {{Infobox calendar date today}}, where datetimes are presented to readers. — Peterwhy (talk) 00:52, 18 February 2026 (UTC)
- Which takes it back to the original question: will it have any effect (at {{Infobox calendar date today}})? If there is a problem (and I've never seen it but if one person bothered to report it then at least a hundred more visitors experienced it), is it in MediaWiki? And might it just frustrate people more?
- Or do we just put it down to "one of those things that happens sometimes, sorry" and park it for someone in the future to resolve when browser technology has evolved. 𝕁𝕄𝔽 (talk) 13:04, 18 February 2026 (UTC)
- I don't really know how the cache update period is determined or adjusted, but sure a period longer than one day is not ideal for that infobox in Anno Domini. According to Help:Purge#Templates, using {{#time}} means the server cache is updated more frequently, but I don't see what the frequency is from that help page. As an editor, the best I can do would be to restore that [refresh] button, so readers know how to do that. — Peterwhy (talk) 20:53, 18 February 2026 (UTC)
- I don't think {{TODAY}} will add a purge button, because it was designed to return a plain text of just DMY. This is so that other templates can still accept the result of {{TODAY}} and work. Alternatively, one can add a purge button to {{Infobox calendar date today}}, where datetimes are presented to readers. — Peterwhy (talk) 00:52, 18 February 2026 (UTC)
- I'm afraid I don't follow your explanation but that doesn't matter really so long as there is a plan to resolve the issue? 𝕁𝕄𝔽 (talk) 00:12, 18 February 2026 (UTC)
| Today |
|
[] |
- I thought I would be able to do it by copying the button from Template:Today in AD, SH, and AH but it seems not. The code is simple
- &_lsqb;<_span class="plainlinks"_>{{Purge|refresh}} &_rsqb; (without the underscores
- but I can't see how to get the output to go in the box. Any ideas? 𝕁𝕄𝔽 (talk) 21:52, 18 February 2026 (UTC)
- For {{Infobox calendar date today}}, which is an {{Infobox}}, the refresh button may be in the infobox footer, as
|below={{Purge|refresh}}or with surrounding square brackets. For example, I am trying the "below" parameter in its sandbox. — Peterwhy (talk) 22:35, 18 February 2026 (UTC)- Looks good to me. (I haven't come across an infobox footer before). I think it needs the square brackets unless you are going to be clever clever and make it false-3D like refresh. Will you make it live? 𝕁𝕄𝔽 (talk) 15:35, 19 February 2026 (UTC)revised --𝕁𝕄𝔽 (talk) 15:39, 19 February 2026 (UTC)
Done and added a refresh link to {{Infobox calendar date today}}. That link can't be formatted as a {{Clickable button}}, as the infobox is used in the article namespace. — Peterwhy (talk) 19:50, 19 February 2026 (UTC)
- Looks good to me. (I haven't come across an infobox footer before). I think it needs the square brackets unless you are going to be clever clever and make it false-3D like refresh. Will you make it live? 𝕁𝕄𝔽 (talk) 15:35, 19 February 2026 (UTC)revised --𝕁𝕄𝔽 (talk) 15:39, 19 February 2026 (UTC)
- For {{Infobox calendar date today}}, which is an {{Infobox}}, the refresh button may be in the infobox footer, as
- I thought I would be able to do it by copying the button from Template:Today in AD, SH, and AH but it seems not. The code is simple