<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://commons.islamical.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ADTZ</id>
	<title>Module:DTZ - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://commons.islamical.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ADTZ"/>
	<link rel="alternate" type="text/html" href="https://commons.islamical.org/w/index.php?title=Module:DTZ&amp;action=history"/>
	<updated>2026-09-26T14:35:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://commons.islamical.org/w/index.php?title=Module:DTZ&amp;diff=3967&amp;oldid=prev</id>
		<title>Shahroudi: Created page with &quot;--[[     Format date/times with time zones. Input can be specified using the following subset of ISO 8601:  YYYY-MM-DDTHH:MMZ       (UTC) YYYY-MM-DDTHH:MM+HH     (hours ahead of UTC) YYYY-MM-DDTHH:MM+HH:MM  (hours and minutes ahead of UTC) YYYY-MM-DDTHH:MM-HH     (hours behind of UTC) YYYY-MM-DDTHH:MM-HH:MM  (hours and minutes behind of UTC)  and similar strings with seconds included in the time:  YYYY-MM-DDTHH:MM:SSZ YYYY-MM-DDTHH:MM:SS+HH YYYY-MM-DDTHH:MM:SS+HH:MM YYYY...&quot;</title>
		<link rel="alternate" type="text/html" href="https://commons.islamical.org/w/index.php?title=Module:DTZ&amp;diff=3967&amp;oldid=prev"/>
		<updated>2026-09-25T08:52:43Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;--[[     Format date/times with time zones. Input can be specified using the following subset of ISO 8601:  YYYY-MM-DDTHH:MMZ       (UTC) YYYY-MM-DDTHH:MM+HH     (hours ahead of UTC) YYYY-MM-DDTHH:MM+HH:MM  (hours and minutes ahead of UTC) YYYY-MM-DDTHH:MM-HH     (hours behind of UTC) YYYY-MM-DDTHH:MM-HH:MM  (hours and minutes behind of UTC)  and similar strings with seconds included in the time:  YYYY-MM-DDTHH:MM:SSZ YYYY-MM-DDTHH:MM:SS+HH YYYY-MM-DDTHH:MM:SS+HH:MM YYYY...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[  &lt;br /&gt;
 &lt;br /&gt;
Format date/times with time zones. Input can be specified using the following&lt;br /&gt;
subset of ISO 8601:&lt;br /&gt;
&lt;br /&gt;
YYYY-MM-DDTHH:MMZ       (UTC)&lt;br /&gt;
YYYY-MM-DDTHH:MM+HH     (hours ahead of UTC)&lt;br /&gt;
YYYY-MM-DDTHH:MM+HH:MM  (hours and minutes ahead of UTC)&lt;br /&gt;
YYYY-MM-DDTHH:MM-HH     (hours behind of UTC)&lt;br /&gt;
YYYY-MM-DDTHH:MM-HH:MM  (hours and minutes behind of UTC)&lt;br /&gt;
&lt;br /&gt;
and similar strings with seconds included in the time:&lt;br /&gt;
&lt;br /&gt;
YYYY-MM-DDTHH:MM:SSZ&lt;br /&gt;
YYYY-MM-DDTHH:MM:SS+HH&lt;br /&gt;
YYYY-MM-DDTHH:MM:SS+HH:MM&lt;br /&gt;
YYYY-MM-DDTHH:MM:SS-HH&lt;br /&gt;
YYYY-MM-DDTHH:MM:SS-HH:MM&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local Date = require(&amp;#039;Module:DateI18n-585816189&amp;#039;)&lt;br /&gt;
local errorcat = &amp;quot;[[Category:Incorrect use of DTZ]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local function format(year, month, day, hour, minute, second, tzhour, tzmin, lang)&lt;br /&gt;
    local result = Date._Date({year, month, day, hour, minute, second, tzhour, tzmin}, lang)&lt;br /&gt;
    if result == &amp;#039;&amp;#039; then&lt;br /&gt;
       return &amp;quot;invalid values in date/time&amp;quot; .. errorcat&lt;br /&gt;
    end&lt;br /&gt;
    return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.DTZ(frame)&lt;br /&gt;
       local input = mw.text.trim(frame.args[1])&lt;br /&gt;
       local lang = frame:callParserFunction(&amp;quot;int&amp;quot;, &amp;quot;lang&amp;quot;) -- user&amp;#039;s language --&lt;br /&gt;
       local all, year, month, day, hour, minute, second = input:match(&amp;quot;^((%d%d%d%d)-(%d%d)-(%d%d)T(%d%d):(%d%d):(%d%d))&amp;quot;)&lt;br /&gt;
       if all == nil then&lt;br /&gt;
          all, year, month, day, hour, minute = input:match(&amp;quot;^((%d%d%d%d)-(%d%d)-(%d%d)T(%d%d):(%d%d))&amp;quot;)&lt;br /&gt;
         if all == nil then&lt;br /&gt;
            return &amp;quot;invalid date/time format&amp;quot; .. errorcat&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       local tzhour, tzmin&lt;br /&gt;
       local rest = input:sub(all:len()+1)&lt;br /&gt;
       if rest == &amp;#039;&amp;#039; then&lt;br /&gt;
          return &amp;quot;missing timezone&amp;quot; .. errorcat&lt;br /&gt;
       end&lt;br /&gt;
       if rest:len() == 1 and rest:sub(1,1) == &amp;#039;Z&amp;#039; then&lt;br /&gt;
          return format(year, month, day, hour, minute, second, &amp;#039;0&amp;#039;, &amp;#039;&amp;#039;, lang)&lt;br /&gt;
       end&lt;br /&gt;
       local tzsign&lt;br /&gt;
       tzsign, tzhour, tzmin = rest:match(&amp;quot;^([+-])(%d%d):(%d%d)$&amp;quot;)&lt;br /&gt;
       if tzsign == nil then&lt;br /&gt;
          tzsign, tzhour = rest:match(&amp;quot;^([+-])(%d%d)$&amp;quot;)&lt;br /&gt;
          if tzsign == nil then&lt;br /&gt;
            return &amp;quot;invalid timezone&amp;quot; .. errorcat&lt;br /&gt;
          end     &lt;br /&gt;
          tzmin = &amp;#039;00&amp;#039; -- work around a glitch in Module:Date --&lt;br /&gt;
       end&lt;br /&gt;
       if tzsign == &amp;#039;-&amp;#039; then&lt;br /&gt;
          tzhour = -1 * tzhour&lt;br /&gt;
       end&lt;br /&gt;
       return format(year, month, day, hour, minute, second, tzhour, tzmin, lang)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Shahroudi</name></author>
	</entry>
</feed>