<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://tinlizzie.org/IA/index.php?action=history&amp;feed=atom&amp;title=Template%3ADts%2Fdoc</id>
		<title>Template:Dts/doc - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://tinlizzie.org/IA/index.php?action=history&amp;feed=atom&amp;title=Template%3ADts%2Fdoc"/>
		<link rel="alternate" type="text/html" href="http://tinlizzie.org/IA/index.php?title=Template:Dts/doc&amp;action=history"/>
		<updated>2026-05-02T18:59:18Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.1</generator>

	<entry>
		<id>http://tinlizzie.org/IA/index.php?title=Template:Dts/doc&amp;diff=607&amp;oldid=prev</id>
		<title>Ohshima: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://tinlizzie.org/IA/index.php?title=Template:Dts/doc&amp;diff=607&amp;oldid=prev"/>
				<updated>2017-11-30T04:29:05Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 04:29, 30 November 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;' lang='en'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Ohshima</name></author>	</entry>

	<entry>
		<id>http://tinlizzie.org/IA/index.php?title=Template:Dts/doc&amp;diff=606&amp;oldid=prev</id>
		<title>Eyesnore at 19:28, 27 July 2016</title>
		<link rel="alternate" type="text/html" href="http://tinlizzie.org/IA/index.php?title=Template:Dts/doc&amp;diff=606&amp;oldid=prev"/>
				<updated>2016-07-27T19:28:59Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
&amp;lt;!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --&amp;gt;&lt;br /&gt;
{{High-use|20200+}}&lt;br /&gt;
{{Mbox|type=content|text=Please check that you do actually need this template before using it. Default date sorting does not work for spelled-out month–year or year–month combos and dates before the year 100, but it works in most other circumstances. Furthermore, this template litters the [[devmo:Web/API/Node/textContent|text content]] of tables, and &amp;lt;code&amp;gt;data-sort-value&amp;lt;/code&amp;gt; should generally be preferred. For more information, see {{Section link|Help:Sorting|Date sorting problems}}.}}&lt;br /&gt;
{{COinS safe|n}}&lt;br /&gt;
{{lua|Module:Dts}}&lt;br /&gt;
&lt;br /&gt;
'''Dts''' (date time sorting) is used to correctly sort and display dates in a sortable table (see [[Help:Sorting]]).&lt;br /&gt;
&lt;br /&gt;
==What it solves==&lt;br /&gt;
Dates in their customary formats, if simply treated as alphanumeric text strings, sort in nonsensical ways:&lt;br /&gt;
*1/8/2013 sorts alphanumerically before 5/3/1967, because ''1'' is less than ''5'';&lt;br /&gt;
*February 5, 1922 sorts alphanumerically before January 3, 1922, because ''F'' comes before ''J''.&lt;br /&gt;
Use of the YYYY-MM-DD format would solve this problem, but with minor exceptions that format is not used in articles (see [[WP:DATEFORMAT]]).&lt;br /&gt;
&lt;br /&gt;
This template automatically attaches a &amp;quot;hidden key&amp;quot; to dates, causing them to sort correctly while still being displayed in one of the customary display formats such as ''February 5, 1922'' or ''5 Feb 1922''.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
===Dates===&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|-&lt;br /&gt;
|+The year, month and day can either be entered separately or as a single date.&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; |{{tlf|dts|''year''|''month''|''day''|''BC''}}&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot; |{{tlf|dts|''date''}}&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
* 1st parameter – Year (optional if month is given)&lt;br /&gt;
** Positive number (1 to 999,999,999,999) represent years AD or BC (dependant on the fourth parameter).&lt;br /&gt;
** Negative numbers (−1 to −999,999,999,999) represent years BC (without the fourth parameter).&lt;br /&gt;
** Year numbers must not contain commas or other formatting.&lt;br /&gt;
* 2nd parameter – Month (optional if the day is not given either)&lt;br /&gt;
** Full month name – e.g. February&lt;br /&gt;
** Abbreviated month name – e.g. Feb&lt;br /&gt;
** Month number – (either zero-padded or not) e.g. 2 or 02&lt;br /&gt;
* 3rd parameter – Day (optional)&lt;br /&gt;
** Day number – (either zero-padded or not) e.g. 7 or 07&lt;br /&gt;
* 4th parameter – (optional)&lt;br /&gt;
** May be BC, AD, BCE or CE&lt;br /&gt;
** Used with a positive year number&lt;br /&gt;
|&lt;br /&gt;
* 1st parameter – the full date&lt;br /&gt;
** By default YYYY-MM-DD format becomes month-day-year format while other formats remain in the order they are input.&lt;br /&gt;
** Abbreviated months are accepted and are abbreviated in the output.&lt;br /&gt;
** Capitalisation and comma mistakes are corrected.&lt;br /&gt;
** A single number is interpreted as a year, otherwise the date is parsed by the module. The following formats are accepted:&lt;br /&gt;
*** YYYY-MM-DD&lt;br /&gt;
*** DD-MM-YYYY&lt;br /&gt;
*** DD Month YYYY&lt;br /&gt;
*** Month DD, YYYY&lt;br /&gt;
*** YYYY-MM&lt;br /&gt;
*** DD Month&lt;br /&gt;
*** Month DD&lt;br /&gt;
*** Month YYYY&lt;br /&gt;
*** YYYY&lt;br /&gt;
*** Month&lt;br /&gt;
** Day and month numbers may be 1 or 2 digits, and year numbers may only be 3 or 4 digits. If you need to input a number less than 1000, use leading zeroes (e.g. &amp;quot;0700&amp;quot;).&lt;br /&gt;
** BC years can only be parsed if the date is only the year number.&lt;br /&gt;
** If you need to include the day or month for BC years or years greater than 9999, you must use separate parameters for year, month and day.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Examples&lt;br /&gt;
!input style&lt;br /&gt;
!input code&lt;br /&gt;
!hidden sort key&lt;br /&gt;
!visible output&lt;br /&gt;
{{dts/testcases/row|span=3|a={{tlf|dts|''year''}}|1893}}&lt;br /&gt;
{{dts/testcases/row|-89}}&lt;br /&gt;
{{dts/testcases/row|-10000}}&lt;br /&gt;
{{dts/testcases/row|a={{tlf|dts|''month''}}|Oct}}&lt;br /&gt;
{{dts/testcases/row|a={{tlf|dts|''month year''}}|February 1767}}&lt;br /&gt;
{{dts/testcases/row|a={{tlf|dts|''day month year''}}|12 Aug 1987}}&lt;br /&gt;
{{dts/testcases/row|a={{tlf|dts|''month day, year''}}|July 1, 1867}}&lt;br /&gt;
{{dts/testcases/row|a={{tlf|dts|''day month''}}|25 October}}&lt;br /&gt;
{{dts/testcases/row|a={{tlf|dts|''month day''}}|Jan 1}}&lt;br /&gt;
{{dts/testcases/row|a={{tlf|dts|''YYYY-MM-DD''}}|2014-12-09}}&lt;br /&gt;
{{dts/testcases/row|span=3|a={{tlf|dts|''year''|''month''}}|1990|10}}&lt;br /&gt;
{{dts/testcases/row|1980|Dec}}&lt;br /&gt;
{{dts/testcases/row|1970|August}}&lt;br /&gt;
{{dts/testcases/row|span=2|a={{tlf|dts|''year''|''month''|''day''}}|2024|Jun|12}}&lt;br /&gt;
{{dts/testcases/row|-204|11|22}}&lt;br /&gt;
{{dts/testcases/row|span=2|a={{tlf|dts|''year''|''month''|''day''|''era''}}|44|3|15|BC}}&lt;br /&gt;
{{dts/testcases/row|94|Oct|17|AD}}&lt;br /&gt;
{{dts/testcases/row|a={{tlf|dts||''month''}}||May}}&lt;br /&gt;
{{dts/testcases/row|a={{tlf|dts||''month''|''day''}}||Sep|12}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Formatting===&lt;br /&gt;
Using &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; produces a format that depends on, but is not necessarily equal to the format of the supplied date. The &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; parameter can take nine values.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Examples&lt;br /&gt;
|-&lt;br /&gt;
!value&lt;br /&gt;
!function&lt;br /&gt;
!input code&lt;br /&gt;
!hidden sort key&lt;br /&gt;
!visible output&lt;br /&gt;
{{dts/testcases/row|span=3|a=&amp;amp;nbsp;|b=format depends on the input|26 Jan 1788}}&lt;br /&gt;
{{dts/testcases/row|March 12, 1557}}&lt;br /&gt;
{{dts/testcases/row|1975-02-13}}&lt;br /&gt;
{{dts/testcases/row|span=2|a=&amp;lt;code&amp;gt;dmy&amp;lt;/code&amp;gt;|b=displays the date in day-month-year format|Sep 13, 1888|format=dmy}}&lt;br /&gt;
{{dts/testcases/row|1983-01-03|format=dmy}}&lt;br /&gt;
{{dts/testcases/row|span=2|a=&amp;lt;code&amp;gt;dm&amp;lt;/code&amp;gt;|b=displays only the day and month in day-month format|Feb 26, 1788|format=dm}}&lt;br /&gt;
{{dts/testcases/row|2020-10-15|format=dm}}&lt;br /&gt;
{{dts/testcases/row|span=2|a=&amp;lt;code&amp;gt;mdy&amp;lt;/code&amp;gt;|b=displays the date in month-day-year format|August 31, 1901|format=mdy}}&lt;br /&gt;
{{dts/testcases/row|2006-11-08|format=mdy}}&lt;br /&gt;
{{dts/testcases/row|span=2|a=&amp;lt;code&amp;gt;md&amp;lt;/code&amp;gt;|b=displays only the day and month in month-day format|26 Jun 1988|format=md}}&lt;br /&gt;
{{dts/testcases/row|2002-02-27|format=md}}&lt;br /&gt;
{{dts/testcases/row|a=&amp;lt;code&amp;gt;my&amp;lt;/code&amp;gt;|b=displays only the month and year in month-year format|16 November 1488|format=my}}&lt;br /&gt;
{{dts/testcases/row|a=&amp;lt;code&amp;gt;d&amp;lt;/code&amp;gt;|b=displays only the day|6 July 1666|format=d}}&lt;br /&gt;
{{dts/testcases/row|a=&amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt;|b=displays only the month|1980-02-12|format=m}}&lt;br /&gt;
{{dts/testcases/row|a=&amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;|b=displays only the year|-26|Jan|18|format=y}}&lt;br /&gt;
{{dts/testcases/row|a=&amp;lt;code&amp;gt;hide&amp;lt;/code&amp;gt;|b=hides the date|15 October 1800|format=hide}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Abbreviation===&lt;br /&gt;
There are two ways of abbreviating the month name.&lt;br /&gt;
# Directly input an abbreviated month name.&lt;br /&gt;
# Use the &amp;lt;code&amp;gt;abbr=on&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Examples&lt;br /&gt;
|-&lt;br /&gt;
!abbreviation method&lt;br /&gt;
!input code&lt;br /&gt;
!hidden sort key&lt;br /&gt;
!visible output&lt;br /&gt;
{{dts/testcases/row|span=4|a=none|2000-01-01}}&lt;br /&gt;
{{dts/testcases/row|2000|1|1}}&lt;br /&gt;
{{dts/testcases/row|1 January 2000}}&lt;br /&gt;
{{dts/testcases/row|2000|January|1}}&lt;br /&gt;
{{dts/testcases/row|span=2|a=abbreviated input|1 Jan 2000}}&lt;br /&gt;
{{dts/testcases/row|2000|Jan|1}}&lt;br /&gt;
{{dts/testcases/row|span=4|a=&amp;lt;code&amp;gt;abbr{{=}}on&amp;lt;/code&amp;gt;|1 January 2000|abbr=on}}&lt;br /&gt;
{{dts/testcases/row|2000|January|1|abbr=on}}&lt;br /&gt;
{{dts/testcases/row|2000-01-01|abbr=on}}&lt;br /&gt;
{{dts/testcases/row|2000|1|1|abbr=on}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Additional sort key===&lt;br /&gt;
In case two dates in a table are identical they may be ordered using the &amp;lt;code&amp;gt;addkey&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Examples&lt;br /&gt;
|-&lt;br /&gt;
!input code&lt;br /&gt;
!hidden sort key&lt;br /&gt;
!visible output&lt;br /&gt;
{{dts/testcases/row|2010-10-10|addkey=3}}&lt;br /&gt;
{{dts/testcases/row|2010-10-09}}&lt;br /&gt;
{{dts/testcases/row|2010-10-10|addkey=1}}&lt;br /&gt;
{{dts/testcases/row|2010-10-10}}&lt;br /&gt;
{{dts/testcases/row|2010-10-10|addkey=4}}&lt;br /&gt;
{{dts/testcases/row|2010-10-11}}&lt;br /&gt;
{{dts/testcases/row|2010-10-10|addkey=2}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Wrapping===&lt;br /&gt;
To turn off the suppression of word wraps, use the &amp;lt;code&amp;gt;nowrap=off&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
===Sorting for incomplete dates===&lt;br /&gt;
;Whole months or years: A whole year or month (and year) is sorted according to its first day.&lt;br /&gt;
;Missing years: If the year is not specified, the date will be sorted as if the year were the current year.&lt;br /&gt;
;Blank dates: For no date input at all, the maximum possible sort key is used, so the entry will sort last.&lt;br /&gt;
&lt;br /&gt;
===Error handling===&lt;br /&gt;
Entering an invalid date format will (generally)&amp;lt;!--It's not quite perfect.--&amp;gt; produce an error message such as the one below.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{dts|35 June 1900}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Errors are tracked in [[:Category:Dts templates with errors]].&lt;br /&gt;
&lt;br /&gt;
===Calendar choice===&lt;br /&gt;
The template is not capable of distinguishing Julian and Gregorian calendar dates. Also, it is not capable of taking a date in one calendar as input and outputting a date in the other calendar. Thus, to insure proper sorting, editors must either use one calendar for all dates, or pick a specific changeover date (for example, deciding that 4 October 1582 is Julian and all later dates are Gregorian); this would be done on an article-by article basis. Editors are also responsible for explaining to the reader whether the visible dates are Julian or Gregorian, if there is any possibility of confusion.&lt;br /&gt;
&lt;br /&gt;
===Linking===&lt;br /&gt;
The template formerly linked dates automatically, with &amp;lt;code&amp;gt;link=off&amp;lt;/code&amp;gt; used to suppress linking. In accordance with current guidelines linking of dates is no longer supported and instances of &amp;lt;code&amp;gt;link=off&amp;lt;/code&amp;gt; should be removed. Transclusions using the {{para|link}} parameter are tracked in [[:Category:Dts templates with deprecated parameters]].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* {{tim|dts}}, since on Meta e.g. 09999 9999 induces numeric sort mode, &amp;quot;&amp;amp;&amp;quot; is prefixed to force string sort mode.&lt;br /&gt;
* {{tl|sort}}, sorting by a specified key (also good for complicated numbers, e.g. scientific notation)&lt;br /&gt;
* {{tl|sortname}}, full name sorting (using &amp;quot;last name, first name&amp;quot; as default sort key)&lt;br /&gt;
* {{tl|tts}}, for sorting times in result tables of athletic events (only needed in certain cases - see template documentation)&lt;br /&gt;
* {{tl|mss}}, for sorting times in tables of eclipses&lt;br /&gt;
* {{tl|nts}}, for numbers&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox | |&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:Sorting templates|Dts]]&lt;br /&gt;
[[Category:Date mathematics templates]]&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eyesnore</name></author>	</entry>

	</feed>