Module talk:Time: Difference between revisions

Content deleted Content added
why {timestamp}?: new section
m <font> → <span style>
 
(19 intermediate revisions by 7 users not shown)
Line 97:
:I added {{tag|syntaxhighlight}} to make your code more readable. How does this change make {{tlx|Infobox time zone}} {{tq|work more reliably}}? If that template is 'unreliable', shouldn't fixes be applied there? Why is your proposed code so complex? Can't it be made simpler?
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 16:04, 8 August 2018 (UTC)
::Wouldn't this work just as well?
{{collapse top}}
<syntaxhighlight lang=Lua style="margin-left:4.8em">function p.offset (frame)
local args = getArgs(frame);
Line 263 ⟶ 264:
:*<code><nowiki>{{#invoke:time/sandbox|time|dateonly=yes|df=iso}}</nowiki></code> → {{#invoke:time/sandbox|time|dateonly=yes|df=iso}}
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 21:13, 9 August 2018 (UTC)
::{{ping|Trappist the monk}} Fixed the issues from above:
{{collapse top}}
<syntaxhighlight lang=Lua>
function p.time (frame)
Line 472 ⟶ 474:
['sst'] = {
abbr = 'SST',
dst_abbr = '<nowiki/>',
utc_offset = '08:00',
df = 'dmy',
dst_begins = '<nowiki/>',
dst_ends = '<nowiki/>',
dst_time = '<nowiki/>',
article = 'Time in Singapore' [[User:Fiipchip|Fiipchip]] ([[User talk:Fiipchip|talk]]) 09:56, 15 August 2018 (UTC)
:{{done}}
Line 551 ⟶ 553:
:The purpose of {{para|_TEST_TIME_}} was/is to fix time for the purposes of debugging edge cases and ISO 8601 format is much easier to read than a 14-digit timestamp.
—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 14:56, 6 February 2019 (UTC)
 
: {{Ping|Trappist the monk}} if only for when {{tl|timestamp}} is better off substituted, like for a delayed save with a hard-coded timestamp you'd like to format. I'm glad the testcase functionality was kept, since this fit the bill quite nicely (with timezones to boot). I can transfer this functionality to my sandbox if necessary, but I figured others might find it useful too at some point. &nbsp;&nbsp;<b>~</b>&nbsp;<span style="font-family:Monotype Corsiva; font-size:16px;">[[User:Tom.Reding|Tom.Reding]] ([[User talk:Tom.Reding|talk]] ⋅[[WP:DGAF|dgaf]])</span>&nbsp; 15:33, 6 February 2019 (UTC)
: Any time you want a hard-coded timestamp, actually. And I thought about making an ISO 8601 option for {{tl|timestamp}} or even a {{tl|TimestampISO8601}}, but this was easier, unless there's already a template that outputs that. &nbsp;&nbsp;<b>~</b>&nbsp;<span style="font-family:Monotype Corsiva; font-size:16px;">[[User:Tom.Reding|Tom.Reding]] ([[User talk:Tom.Reding|talk]] ⋅[[WP:DGAF|dgaf]])</span>&nbsp; 15:38, 6 February 2019 (UTC)
::[[mw:Help:Extension:ParserFunctions##time|<code><nowiki>{{#time:}}</nowiki></code> parser function]]?
:::<code><nowiki>{{#time:Y-m-d"T"H:i:s}}</nowiki></code> → {{#time:Y-m-d"T"H:i:s}}
::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 15:58, 6 February 2019 (UTC)
:::Ah, yes that would also work. {{tl|Timestamp}} is much more convenient and intuitively named, though. &nbsp;&nbsp;<b>~</b>&nbsp;<span style="font-family:Monotype Corsiva; font-size:16px;">[[User:Tom.Reding|Tom.Reding]] ([[User talk:Tom.Reding|talk]] ⋅[[WP:DGAF|dgaf]])</span>&nbsp; 16:17, 6 February 2019 (UTC)
 
== How to revert time section? ==
 
Hi, I want to revert from like July 26th, 2019 (7/26/2019) to 26 July 2019 (26/7/2019) to suitable to my wiki which is Vietnamese Wikipedia (26 tháng 7 năm 2019). Is there anyway to do that on Module? I have created one on my Wiki with same name. [[User:Phjtieudoc|<strong style="font-size:small; color:#01A6E1"><var>phjtieudoc </var></strong>]] ([[User talk:Phjtieudoc|<em style="font-size:small; color:#FF3F1A">Talk</em>]]) 04:25, 26 July 2019 (UTC)
:P.S: Please Ping me because I don't active much on English Wikipedia. Thanks! [[User:Phjtieudoc|<strong style="font-size:small; color:#01A6E1"><var>phjtieudoc </var></strong>]] ([[User talk:Phjtieudoc|<em style="font-size:small; color:#FF3F1A">Talk</em>]]) 04:26, 26 July 2019 (UTC)
:
:@[[User:Phjtieudoc|Phjtieudoc]]: I don't completely understand your question. [[:vi:Template:Time]] does not use [[:vi:Module:Time]]. :vi:Module:Time uses [[:vi:Module:Time/data]] which is missing (the en.wiki module is [[Module:Time/data|here]]).
:
:{{tlx|time}} uses [[:mw:Help:Extension:ParserFunctions##time]] to format time/date output. Module:Time uses a table in Module:Time/data (<code>cfg['format']</code>) to hold format strings for the <code>#time:</code> parser function. You can edit the format strings in that table to modify how date and time are rendered. The default format is <code>mdy</code> (<code>cfg['default_df']</code>) so the simple <code><nowiki>{{#invoke:Time|time}}</nowiki></code> should produce something like this:
::{{time|lang=vi}}
:Does this help?
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 10:49, 26 July 2019 (UTC)
::{{ping|Trappist the monk}}. Wow. It help me a lot, but is there anyway to add the word "năm" after month, like (26 tháng 7 "năm" 2019). Thanks! [[User:Phjtieudoc|<strong style="font-size:small; color:#01A6E1"><var>phjtieudoc </var></strong>]] ([[User talk:Phjtieudoc|<em style="font-size:small; color:#FF3F1A">Talk</em>]]) 12:14, 26 July 2019 (UTC)
::::@[[User:Phjtieudoc|Phjtieudoc]]: Because [[Module:Time]] uses [[:mw:Help:Extension:ParserFunctions##time]], you can insert quoted text in the format string:
:::::<code><nowiki>{{time |df-cust=H:i, j F "năm" Y |lang=vi}}</nowiki></code> → {{time |df-cust=H:i, j F "năm" Y |lang=vi}}
::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 12:36, 26 July 2019 (UTC)
:::::{{ping|Trappist the monk}} Ok, I did it. Thanks a lot! Have a nice day! [[User:Phjtieudoc|<strong style="font-size:small; color:#01A6E1"><var>phjtieudoc </var></strong>]] ([[User talk:Phjtieudoc|<em style="font-size:small; color:#FF3F1A">Talk</em>]]) 12:54, 26 July 2019 (UTC)
 
== Template-protected edit request on 24 May 2020 ==
 
{{edit template-protected|Module:Time|answered=yes}}
Please apply [[Special:Diff/907957873/958645106]] to allow more kinds of truthy and falsy values to be passed to its boolean(y) parameters by using [[Module:Yesno]]. New test cases for "proper boolean" parameters are [[Template:Time/testcases#Parameter_hide-refresh|at the bottom of the page /testcases]]. New test case for parameter {{para|dst}}, which can also have value <code>'always'</code>, is in [[Template:Time/testcases#No_DST|section "No DST"]]. —⁠[[User:Andrybak|andrybak]] ([[User talk:Andrybak|talk]]) 23:49, 24 May 2020 (UTC)
: {{done}} [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 02:32, 25 May 2020 (UTC)
 
== Template-protected edit request on 15 May 2021 ==
 
{{edit template-protected|Module:Time|answered=yes}}
Can we get the Hawaii–Aleutian abbreviations corrected as per [https://www.nist.gov/pml/time-and-frequency-division/local-time-faqs#zones here] and [https://www.timeanddate.com/time/zones/hast here]?
 
[https://en.wikipedia.org/w/index.php?title=Module%3ATime%2Fdata%2Fsandbox&type=revision&diff=1023313118&oldid=958641078 Diff here]
 
Testcases at [https://en.wikipedia.org/w/index.php?title=Template:Time/testcases&oldid=1023313185#change_to_Hawaii%E2%80%93Aleutian_abbreviation this ___location].
 
Thanks!
 
[[User:Joeyconnick|Joeyconnick]] ([[User talk:Joeyconnick|talk]]) 18:36, 15 May 2021 (UTC)
:Is there a reason why HADT is not an alias of HDT as HAST is an alias of HST? Should it be? Should HAST be dropped from the aliases table?
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 18:50, 15 May 2021 (UTC)
::I was just going with what was there. I guess for completeness/consistency, HADT can be added. [[User:Joeyconnick|Joeyconnick]] ([[User talk:Joeyconnick|talk]]) 18:59, 15 May 2021 (UTC)