Module talk:Time

Shortin month
I think we should shortin the month names to allow for use on Template:Datetime and to keep other templaes short aswell. -- ★BrandonALF★ talk edits 22:41, 16 December 2017 (UTC)
 * It looks to me like you have broken existing uses of . Please revert your changes there.
 * —Trappist the monk (talk) 22:59, 16 December 2017 (UTC)
 * I'm sorry, I didn't realize that was there. So now I need to do my edit for Template:Local time -- ★BrandonALF★ talk edits 23:06, 16 December 2017 (UTC)
 * Thank you. There are 1000+, mostly user pages, that use  and so use this module.  Given that, it would seem to me that you either accept long month names or find a way to tell the module to abbreviate specific   instances.  You don't just decide for everyone that from now on the date will render as an abbreviation.
 * —Trappist the monk (talk) 23:26, 16 December 2017 (UTC)
 * I have raised the protection level of this module to require WP:Template editor permission because you have elected to edit war instead of discuss. Feel free to use sandboxen for your template development.  Also, use testcases pages to do testing before adding your template to mainspace articles.  Testing as you have been doing is considered disruptive and may result in your editing privileges being restricted or revoked.
 * —Trappist the monk (talk) 00:00, 17 December 2017 (UTC)

Documentation
Hey I just discovered this module after I saw it was used on a table at the NFL playoffs article and would like an explanation as to how it works. –Piranha249 (talk) 02:03, 9 January 2018 (UTC)
 * I think that you are mistaken. This module is not used at NFL playoffs.  You can prove this to your self.  Follow this link.  Below the Publish changes button you will see 'Pages transcluded onto the current version of this page'.  Click that to get a list of all templates and modules transcluded in NFL playoffs.  Module:Time is not there.
 * What you are seeing is the  parser function.
 * —Trappist the monk (talk) 02:22, 9 January 2018 (UTC)
 * Oh, I thought it was there, but I forgot the modules start with Invoke. –Piranha249 (talk) 02:32, 9 January 2018 (UTC)
 * Oh, I thought it was there, but I forgot the modules start with Invoke. –Piranha249 (talk) 02:32, 9 January 2018 (UTC)

Abbreviations for Hawaii-Aleutian time zones are wrong
The page on Hawaii–Aleutian Time Zone was changed recently to have the abbreviations HAST/HADT in the infobox, which are incorrect. The infoxbox references this module. The correct abbreviations are HST/HDT, but the reason why it was changed is because this module does not have HST/HDT. To fix this, the lines that read:

['hast'] = {	-- same as AleutST and HST abbr = 'HAST', dst_abbr = 'HADT',

need to be changed to:

['hst'] = {	-- same as AleutST abbr = 'HST',	-- note: not HAST or HADT dst_abbr = 'HDT',

—Mordomo (talk) 12:54, 11 August 2018 (UTC)

Template-protected edit request on 8 August 2018

 * These edits add a function which allows the module to output the UTC offset of a timezone. The output would be able to replace many templates and would allow Template:Infobox time zone to work more reliably. I've done testing to make sure both positive and negative UTC offsets work and function time still works here. — BrandonXLF   (t@lk) (ping back) 15:34, 8 August 2018 (UTC)
 * I added  to make your code more readable. How does this change make  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?
 * —Trappist the monk (talk) 16:04, 8 August 2018 (UTC)
 * Wouldn't this work just as well?


 * —Trappist the monk (talk) 16:37, 8 August 2018 (UTC)

Yes it would, because it's smaller and more efficient I prefer if your code is added. It makes more reliable because currently it's using a template that doesn't have a lot of timezone, where as Module:time as a lot of time zones already. — BrandonXLF   (t@lk) (ping back) 16:51, 8 August 2018 (UTC)
 * You are speaking of ? Looks to me like there are 155 timezones listed.  That number is rather more than the number listed in Module:Time.
 * —Trappist the monk (talk) 17:04, 8 August 2018 (UTC)
 * Sorry, I forgot I switch it back to use that tempalte, but the issue is there's many repeated abbreviation and rather then breaking the template into DST and non DST it would be easier to add this function, besides the infobox already uses module:time to display the time of the timezone. — BrandonXLF   (t@lk) (ping back) 17:10, 8 August 2018 (UTC)
 * I'm confused. You created that template which does support DST, something that   won't.  If there are repeated abbreviation[s] then isn't it a simple matter of locating and excising those?  I could imagine translating the information in  into a Lua table and then having     and use that table instead of using the   table.  Later,   might be adapted to use the   table.
 * —Trappist the monk (talk) 10:33, 9 August 2018 (UTC)
 * I'll figure something out. — BrandonXLF   (t@lk) (ping back) 14:27, 9 August 2018 (UTC)
 * Related to the above, I have moved the /sandbox data table to Module:Time/data/sandbox. This ought to make is easier to create a utc offsets table and function.
 * —Trappist the monk (talk) 15:10, 11 August 2018 (UTC)

Template-protected edit request on 9 August 2018
replace p.time with

What it does is add parameters timeonly and dateonly, which allows the module to output the time or date of an timezone. This would be very helpful in the userspace and in some templates. — BrandonXLF   (t@lk) (ping back) 20:46, 9 August 2018 (UTC)
 * Not ready, methinks:
 * —Trappist the monk (talk) 21:13, 9 August 2018 (UTC)
 * Fixed the issues from above:
 * —Trappist the monk (talk) 21:13, 9 August 2018 (UTC)
 * Fixed the issues from above:
 * —Trappist the monk (talk) 21:13, 9 August 2018 (UTC)
 * Fixed the issues from above:
 * Fixed the issues from above:

— BrandonXLF   (t@lk) (ping back) 01:12, 10 August 2018 (UTC)
 * You didn't actually. I've rewritten that section of the code so that it is simpler.  Here are some results:
 * time & date:
 * df=y
 * df=mdy
 * df=mdy12
 * df=dmy
 * df=dmy12
 * df=iso
 * time only:
 * df=mdy
 * df=mdy12
 * df=dmy
 * df=dmy12
 * df=iso
 * date only:
 * df=y
 * df=mdy
 * df=mdy12
 * df=dmy
 * df=dmy12
 * df=iso
 * —Trappist the monk (talk) 12:43, 10 August 2018 (UTC)
 * That works too. I think that refresh link can be annoying as some need it in different places so I added refresh to the sandbox
 * refresh=yes
 * refresh=no
 * — BrandonXLF   (t@lk) (ping back) 13:37, 10 August 2018 (UTC)
 * Tweaked that a bit. Why have you chosen to omitted the timezone abbreviation when yes and yes?  It seems to me that the default rendering must include the timezone abbreviation else readers don't know where the time/date applies.
 * —Trappist the monk (talk) 15:08, 10 August 2018 (UTC)
 * I've chosen to ommit time timezone abbreviation because some templates are like "It's 21:30 where this user lives" If you want to include the abbreviation you can add a parameter like abbrev to include it or not. — BrandonXLF   (t@lk) (ping back) 19:39, 10 August 2018 (UTC)
 * I added show_tz
 * show_tz=yes
 * show_tz=no
 * — BrandonXLF   (t@lk) (ping back) 22:59, 10 August 2018 (UTC)
 * I added show_tz
 * show_tz=yes
 * show_tz=no
 * — BrandonXLF   (t@lk) (ping back) 22:59, 10 August 2018 (UTC)
 * — BrandonXLF   (t@lk) (ping back) 22:59, 10 August 2018 (UTC)

Parameter names and the internal variables that they feed should make sense when read and should indicate the action that will occur. no was a poor choice because the word 'refresh' is a verb indicating action. As I used the variable  in the /sandbox, when   then render a refresh link. You reversed that to mean when  then render a refresh link. That's just confusing. I have renamed refresh to hide-refresh: Similarly, I renamed show_tz to hide-tz: and while at it, created unlink-tz: —Trappist the monk (talk) 12:01, 11 August 2018 (UTC)
 * hide-refresh=yes
 * hide-refresh=no
 * hide-tz=yes
 * hide-tz=no
 * unlink-tz=yes
 * unlink-tz=no
 * That makes more sense. Thanks. — BrandonXLF   (t@lk) (ping back) 13:02, 11 August 2018 (UTC)
 * Can you implement the code in the sandbox or do you have issues with it? — BrandonXLF   (t@lk) (ping back) 19:25, 12 August 2018 (UTC)
 * If you mean update the live module, then, I can – when you are done with the sandbox.
 * —Trappist the monk (talk) 08:58, 13 August 2018 (UTC)
 * I made a few changes in the sandbox and I updated the documentation. If you have any issues let me know, else I'm done with the sandbox.— BrandonXLF   (t@lk) (ping back) 16:16, 15 August 2018 (UTC)
 * Looks to me like you broke hide-refresh, hide-tz, and unlink-tz so I have repaired those. I don't think that you should have deleted timeonly so I have restored that.  You created a new but malformed and extraneous   so I deleted that, renamed   to   and restored the export table.
 * You continued to make changes after you had said that you were done so how am I to believe that you really are done?
 * —Trappist the monk (talk) 12:07, 16 August 2018 (UTC)
 * Everything is working properly and you made your final edits, so I'm done with the sandbox. Really this time. — BrandonXLF   (t@lk) (ping back) 13:02, 16 August 2018 (UTC)
 * —Trappist the monk (talk) 13:21, 17 August 2018 (UTC)
 * —Trappist the monk (talk) 13:21, 17 August 2018 (UTC)
 * —Trappist the monk (talk) 13:21, 17 August 2018 (UTC)

Template-protected edit request on 15 August 2018
Hi, Kindly help to add the time zone for Singapore. Thank you.

['sst'] = { abbr = 'SST', dst_abbr = ' ', utc_offset = '08:00', df = 'dmy', dst_begins = ' ', dst_ends = ' ', dst_time = ' ', article = 'Time in Singapore' Fiipchip (talk) 09:56, 15 August 2018 (UTC)
 * —Trappist the monk (talk) 10:55, 15 August 2018 (UTC)
 * —Trappist the monk (talk) 10:55, 15 August 2018 (UTC)

Template-protected edit request on 3 September 2018
I've made some edits to the sandbox (diff) and data/sandbox (diff). These edits add support for DST timezone such as EST and other names that timezone are known as (the list is small right now) such as ET. It also adds more support for UTC offsets so +5, -5 ,+05, -05:30, -5.5 all work with it. A test page can be seen at User:BrandonXLF/sandbox/5. – BrandonXLF   (t@lk)  02:33, 3 September 2018 (UTC)
 * where is the need for the module to support dst timezone abbreviations as primary inputs? where is the need to display dst time during non-dst periods (edt in January)?  where is the need for all of these variations on the utc offset theme?  doesn't work for bst and ist because these abbreviations are already in use – i didn't check the rest.
 * —Trappist the monk (talk) 03:10, 3 September 2018 (UTC)
 * There're some templates the currently use a ineffecient system of getting information, for these templates to have any chance of using the module these have to be supported, also it make the module much more useful and easier to use. – BrandonXLF   (t@lk)  03:30, 3 September 2018 (UTC)
 * What templates? How do these changes make the module much more useful and easier to use?
 * —Trappist the monk (talk) 11:03, 3 September 2018 (UTC)
 * It's more convient when you don't need to enter the full UTC offset and in some causes users may want the time of a DST timezone. Some templates that could switch over are Current minute in time zone and similar. And it just adds more functionality. – BrandonXLF   (t@lk)  16:22, 3 September 2018 (UTC)
 * I might be persuaded that there is some sense in loosening the requirements for utc offset provided, however, that you do a better job with the code which is clearly not ready.
 * I am not persuaded that accepting dst timezone abbreviations is warranted. I might be persuaded that alternate standard (non-dst) abbreviations have some small benefit.
 * —Trappist the monk (talk) 17:41, 3 September 2018 (UTC)
 * But what harm does it do? If you're already making a edit why not include them in it? – BrandonXLF   (t@lk)  19:46, 3 September 2018 (UTC)
 * Nonsense output as I mentioned before: when given a dst timezone abbreviation your code produces a dst time when dst is not in effect:
 * I also pointed out that  is assigned to Bangladesh standard time so can't be used for British summer time and that   is assigned to Indian standard time so can't be used for – I don't know what you intended   for:
 * → (time in Bangladesh)
 * → (time in India)
 * —Trappist the monk (talk) 11:06, 5 September 2018 (UTC)
 * Ok, I removed IST and BST from the list, if you think it still has no use let me know and I'll remove it. Personally I think some people would find it useful, but you're the person making the edit in the end. As I said I'll gladly remove it if that's what you want. Also, please me when replying. Thanks, –  BrandonXLF   (t@lk)  22:52, 5 September 2018 (UTC)
 * Note: The DST time zones output DST time even when it's not DST, because they are DST time zones and such always should output DST. – BrandonXLF   (t@lk)  22:54, 5 September 2018 (UTC)
 * The DST time zones output DST time even when it's not DST. Yes, that is what your code does, and I think that it is nonsensical because dst implies that it has been switched from and will switch back to standard time (without researching it, I suspect that this is probably why Saskatchewan, which used to be in mst/mdt, is now considered to be in cst year round).
 * I can imagine supporting dst timezone abbreviations as aliases of standard timezone abbreviations (as long as the dst abbreviation doesn't conflict with an existing standard timezone abbreviation) which would cause the template's output to be rendered exactly the same for regardless of which abbreviation (dst or standard) is used.
 * —Trappist the monk (talk) 13:12, 6 September 2018 (UTC)
 * Ok, sure I'll make then aliases instead of how they are. – BrandonXLF   (t@lk)  20:22, 6 September 2018 (UTC)
 * I can imagine supporting dst timezone abbreviations as aliases of standard timezone abbreviations (as long as the dst abbreviation doesn't conflict with an existing standard timezone abbreviation) which would cause the template's output to be rendered exactly the same for regardless of which abbreviation (dst or standard) is used.
 * —Trappist the monk (talk) 13:12, 6 September 2018 (UTC)
 * Ok, sure I'll make then aliases instead of how they are. – BrandonXLF   (t@lk)  20:22, 6 September 2018 (UTC)

I made the DST offset aliases, I added more aliases, I made it so you can set dst=always for it to always be DST (takes very little code) and I removed all code that you said needed to be removed? Is it good now, I'm always happy to add suggestions. I also added HST as a seprate timezone as per and my own research. – BrandonXLF   (t@lk)  20:32, 7 September 2018 (UTC)
 * As a lot has changed I made a new request – BrandonXLF   (t@lk)  01:02, 9 September 2018 (UTC)

Template-protected edit request on 9 September 2018
A update to, Replace the contents of Module:time with Module:time/sandbox (diff) and the contents of Module:time/data with Module:time/data/sandbox (diff). Examples of usage can be seen at User:BrandonXLF/sandbox/5. These edits add: 1) Aliases, extra abbreviations of timezones that allow for previous abbreviations that returned unknown to now return a timezone (including DST timezones) 2) More UTC offset support, allows for more support for UTC offsets (such as -5, +5, +8:30 and -9.5 NEW: +6.4) 3) DOW, adds dow as a format in the format table (NEW) Note: This edit also addresses –  BrandonXLF   (t@lk)  00:56, 11 September 2018 (UTC)
 * In the previous discussion I did write: I might be persuaded that there is some sense in loosening the requirements for utc offset provided, however, that you do a better job with the code which is clearly not ready. You ignored that comment.  For example:
 * —Trappist the monk (talk) 01:13, 9 September 2018 (UTC)
 * I didn't even see part, my bad. I'll let you know when I do that, – BrandonXLF   (t@lk)  15:02, 9 September 2018 (UTC)
 * I fixed the code and made it simpler, any more suggestions? – BrandonXLF   (t@lk)  18:57, 9 September 2018 (UTC)
 * Perhaps not:
 * —Trappist the monk (talk) 19:29, 9 September 2018 (UTC)
 * The reason that doesn't work is because 1.26 = UTC+01:15.6 and you can't have a UTC offset of 1:15.6, if you'd like I can add a rounding function. So UTC1:15.6 ---> UTC1:16. Please let me know if I should add it. – BrandonXLF   (t@lk)  19:41, 9 September 2018 (UTC)
 * The module should gracefully accept whatever it is given as input. The big red lua script error message is not graceful.  So if I type:
 * where there is not timezone called 'bob', the module should gracefully fail:
 * June 29, 2024
 * and it does but the sandbox doesn't:
 * —Trappist the monk (talk) 19:54, 9 September 2018 (UTC)
 * I added an error code, is it good now? – BrandonXLF   (t@lk)  20:02, 9 September 2018 (UTC)
 * I got the error code working for  too, it looks like . Please let me know if you have any other suggestions. –  BrandonXLF   (t@lk)  00:15, 10 September 2018 (UTC)
 * I made some monior fixes such as producing better error codes and accepting more logical inputs. I also added dow to the date format table, I think it could be useful. As far as this edit request goes I'm done unless you have any issues/suggestion about it
 * I have rewritten  so that it is simpler and easier to understand.  I removed the format specification because the default time display format is handled elsewhere.  I do not think that it should be changed from its current iso format; df is there for those who wish a different format.  Fractional hours to two digits are more-or-less properly supported by truncation:
 * —Trappist the monk (talk) 12:05, 11 September 2018 (UTC)
 * Everything looks fine, I'm done editing it. – BrandonXLF   (t@lk)  12:47, 11 September 2018 (UTC)
 * Is everything fine with the proposed edits? Any more questions about the proposed edits? I'm always happy to answer them. – BrandonXLF   (t@lk)  00:51, 13 September 2018 (UTC)
 * Red information icon with gradient background.svg Not done: please make your requested changes to the module's sandbox first; see WP:TESTCASES. Module:Time/testcases is empty and the tests in your sandbox show only the results from the sandbox, not a comparison of live & sandbox showing what your edits fix. You've used the tper template often enough to know which pages the tools link to, and where things ought to be. Cabayi (talk) 21:06, 23 September 2018 (UTC) ✅ as User:Trappist the monk implemented the changes in the sandbox. – BrandonXLF   (t@lk)  16:40, 5 October 2018 (UTC)
 * —Trappist the monk (talk) 12:05, 11 September 2018 (UTC)
 * Everything looks fine, I'm done editing it. – BrandonXLF   (t@lk)  12:47, 11 September 2018 (UTC)
 * Is everything fine with the proposed edits? Any more questions about the proposed edits? I'm always happy to answer them. – BrandonXLF   (t@lk)  00:51, 13 September 2018 (UTC)
 * Red information icon with gradient background.svg Not done: please make your requested changes to the module's sandbox first; see WP:TESTCASES. Module:Time/testcases is empty and the tests in your sandbox show only the results from the sandbox, not a comparison of live & sandbox showing what your edits fix. You've used the tper template often enough to know which pages the tools link to, and where things ought to be. Cabayi (talk) 21:06, 23 September 2018 (UTC) ✅ as User:Trappist the monk implemented the changes in the sandbox. – BrandonXLF   (t@lk)  16:40, 5 October 2018 (UTC)
 * Red information icon with gradient background.svg Not done: please make your requested changes to the module's sandbox first; see WP:TESTCASES. Module:Time/testcases is empty and the tests in your sandbox show only the results from the sandbox, not a comparison of live & sandbox showing what your edits fix. You've used the tper template often enough to know which pages the tools link to, and where things ought to be. Cabayi (talk) 21:06, 23 September 2018 (UTC) ✅ as User:Trappist the monk implemented the changes in the sandbox. – BrandonXLF   (t@lk)  16:40, 5 October 2018 (UTC)

why {timestamp}?
@Tom.Reding: Why ? That gives the same results as without parameters:
 * → June 29, 2024
 * → June 29, 2024
 * The purpose of _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.

—Trappist the monk (talk) 14:56, 6 February 2019 (UTC)


 * if only for when 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.  ~ Tom.Reding (talk ⋅dgaf)  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 timestamp or even a TimestampISO8601, but this was easier, unless there's already a template that outputs that.  ~ Tom.Reding (talk ⋅dgaf)  15:38, 6 February 2019 (UTC)
 * parser function?
 * —Trappist the monk (talk) 15:58, 6 February 2019 (UTC)
 * Ah, yes that would also work. Timestamp is much more convenient and intuitively named, though.  ~ Tom.Reding (talk ⋅dgaf)  16:17, 6 February 2019 (UTC)
 * Ah, yes that would also work. Timestamp is much more convenient and intuitively named, though.  ~ Tom.Reding (talk ⋅dgaf)  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.  phjtieudoc  (Talk ) 04:25, 26 July 2019 (UTC)
 * P.S: Please Ping me because I don't active much on English Wikipedia. Thanks!  phjtieudoc  (Talk ) 04:26, 26 July 2019 (UTC)
 * @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 here).
 * uses mw:Help:Extension:ParserFunctions to format time/date output. Module:Time uses a table in Module:Time/data  to hold format strings for the   parser function.  You can edit the format strings in that table to modify how date and time are rendered.  The default format is    so the simple   should produce something like this:
 * June 29, 2024
 * Does this help?
 * —Trappist the monk (talk) 10:49, 26 July 2019 (UTC)
 * . 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!  phjtieudoc  (Talk ) 12:14, 26 July 2019 (UTC)
 * @Phjtieudoc: Because Module:Time uses mw:Help:Extension:ParserFunctions, you can insert quoted text in the format string:
 * → June 29, 2024
 * —Trappist the monk (talk) 12:36, 26 July 2019 (UTC)
 * Ok, I did it. Thanks a lot! Have a nice day!  phjtieudoc  (Talk ) 12:54, 26 July 2019 (UTC)
 * —Trappist the monk (talk) 12:36, 26 July 2019 (UTC)
 * Ok, I did it. Thanks a lot! Have a nice day!  phjtieudoc  (Talk ) 12:54, 26 July 2019 (UTC)

Template-protected edit request on 24 May 2020
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 at the bottom of the page /testcases. New test case for parameter dst, which can also have value, is in section "No DST". —⁠andrybak (talk) 23:49, 24 May 2020 (UTC)
 * ✅ * Pppery * it has begun... 02:32, 25 May 2020 (UTC)

Template-protected edit request on 15 May 2021
Can we get the Hawaii–Aleutian abbreviations corrected as per here and here?

Diff here

Testcases at this location.

Thanks!

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?
 * —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. Joeyconnick (talk) 18:59, 15 May 2021 (UTC)