Template talk:DTZ

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Milliseconds

[edit]

Hi, according to en:ISO_8601 the time also supports milliseconds (hh:mm:ss.sss). Maybe we should also support it here since i already found a file. --Arnd (talk) 21:04, 15 February 2018 (UTC)[reply]

It wouldn't be useful in that case, since the camera isn't likely to be time synchronised to high precision, and sub-second time wouldn't be important. You'd be lucky if the hour and minute is correct. It could be useful if there were several photos taken together and the exact interval between them was somehow significant. I'd say it should be avoided unless needed, to keep the format simpler and the values easier to convert later. --ghouston (talk) 02:05, 16 February 2018 (UTC)[reply]

Maintenance category

[edit]

In case the time cannot be parsed the file should automatically added to such a category. --Arnd (talk) 21:04, 15 February 2018 (UTC)[reply]

Probably. I'll look into it. When the value can't be parsed, it currently just displays an error string to make it obvious that it's not working properly. --ghouston (talk) 02:05, 16 February 2018 (UTC)[reply]
They'll be added now to Category:Incorrect use of DTZ. --ghouston (talk) 02:42, 16 February 2018 (UTC)[reply]

Template broken?

[edit]

The dates of files are not rendered how they should, e.g. {{DTZ|1968-12-21T07:51Z}} does not show at the moment "+0:00" bit.--Ymblanter (talk) 16:46, 9 September 2021 (UTC)[reply]

Hmm, I checked one of my own files, and it was OK until I purged it. I'll try to figure out what changed. --ghouston (talk) 07:30, 10 September 2021 (UTC)[reply]
Possibly Verdy p's recent changes to Module:DateI18n. There are some test failures at Module:DateI18n/testcases. --ghouston (talk) 07:37, 10 September 2021 (UTC)[reply]
Thanks, let us wait to see what happens. It started for me a few days ago.--Ymblanter (talk) 09:50, 10 September 2021 (UTC)[reply]
@Ghouston: @Ymblanter: You should know that there were other related bugs that I attempted to fix (this was reverted) notably ambiguity between, month and minute when parsing and generating "datecodes".
I made lot of tests with it, but the main problem (that I did not expected) was the fact that other wikis do not handle the ASCII single quote properly in the tabular data. I had also fixed that in the module so that single quotes would be properly converted to double quotes before calling #time. But other wikis still did not have the updated version. So the tabular data was reverted (and still contains single quotes and some erroneuous items that fail to parse correctly in #time).
And there were already various testcases already breaking as well (since long) and I had fixed several of them, adding more comprehensive tests for them.
Many modules have testcases showing errors: that's what I was trying to fix (sometimes these were the testcases that were broken, or that were no longer valid when they compared the module result with the result of an old template, and the module was changed to deviate from the old unmaintained template: I marked these tests with a "varying" option) so that they are no longer considered as "failed", but just show a warning icon, exchibiting the differences, and I added some headings in long testcases (or to show in heading wikitext that was previously in Lua comments)
I was very careful to do what was appropriate and not break anything, the main bug is caused by the fact that other wikis have their own version of the module, and they are not updated (and not fixable directly, because they are locked against any edit, notably on English Wikipedia: the tabular data broke there, but it was unexpected; an admin took the decision to block me against editing these templates here, even though there was no emergency and the fix in tabular data was already applied by me: some bugs may have been left in reneerd wikis pages still in the cache, but this concerns very few pages because it was not occuring for very long, only a few hours when it was properly notified with accurate reproducible demonstrations showing where this effectively broke; my blocking for that is very unfair: the admin that decided to block me made many errors himself in the past, causing bugs unsolved for very long time, and he was not blocked for that; I mauy have caused a bug for a few hours but I had promptly reacted to fix that; many bugs are remaining since very long in modules and their test cases written by various people, including admins, and there are still many missing testcases!).
Note that the "Z" in <nowiki>21 December 1968, 07:51 +00:00 is a timezone indicator: I did not change anything in the way timezones are rendered: if there's one indicated and parsed corerctly, the template still shows the timezone correctly (as expected, even if it is "+00:00"; may be the timezone "+00:00" may be rendered as "Z" (but certainly not dropped silently as if the date was in local time). So this is definitely NOT a bug I made, the rules for rendering timezones was exactly as they were before: the date parser was already dropping timezone indicators and note generating any datecode letter, so it was not rendering them at all (and tabular data did not contain any format to suppport them: I inteded to add more formats in tabular data (to support timezones), but now I can't! The module version has NEVER worked to render timezones (that were already silently dropped, because it couldnot parse timezones using a single letter, and only parsed partially timezones using a "+hh:mm" or "+hh" format, without adding any datecode forthese two fields, and did not accept one-letter "Z" that was also silently dropped; the admin that blocked me was the one that created the module without the support of timezones silently dropped: you may still have pages in caches that used the former template, but when rendered again with the module the "tzhour" and "tzminutes" parameters are discared/ignored). verdy_p (talk) 11:51, 10 September 2021 (UTC)[reply]
@Verdy p: I don't understand much of what you wrote above, since I haven't examined or edited the module recently. I did add the timezone support, back when it was called Module:Date, which was applied by Jarekt in 2016 since I can't edit protected files myself. Timezones were formatted OK as recently as 3 September, when I uploaded File:Korimul Burnie 20210308-001.jpg, which is still fine since it hasn't been purged. The only changes since then have been your edits, and a diff shows some changes after "-- Append a timezone if present". --ghouston (talk) 11:38, 11 September 2021 (UTC)[reply]
Indeed, until a few days ago everything worked, but I have no idea where exactly the problem is.--Ymblanter (talk) 11:51, 11 September 2021 (UTC)[reply]
@Ymblanter and Verdy p: I fixed it for now by creating Module:DateI18n-585816189, which is a copy of the module as at 2021-08-25T17:42:49. Files with missing time zones can hopefully be fixed by purging. --ghouston (talk) 06:50, 13 October 2021 (UTC)[reply]
Great, thank you very much.--Ymblanter (talk) 07:02, 13 October 2021 (UTC)[reply]