Help talk:Time function

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Language code[edit]

[1] Two-letter ISO 639-1 codes only allowed - try it (639-1 / 639-3):

  • {{#timel: xg | | hr}} → ožujka
  • {{#timel: xg | | hrv}} → March
  • {{#timel: xg | | de}} → Märzes
  • {{#timel: xg | | ger}} → March
  • {{#timel: xg | | pl}} → marca
  • {{#timel: xg | | pol}} → March

--Bonč (talk) 23:52, 26 April 2016 (UTC)

What about BCE dates?[edit]

What about BCE dates?

This is an encyclopedia. Encyclopedias include BCE dates in articles on history, religions and biography.

So the sorting and formatting of BCE dates are important functions to consider in Wikipedia. Which makes their absence from the discussion conspicuous.

For example here:

  1. They didn't sort the date column because the historians who care of the page don't know how.
  2. Also they used BC instead of BCE.

This provides some clues as to what to do:

ISO 8601 prescribes, as a minimum, a four-digit year [YYYY] to avoid the year 2000 problem. It therefore represents :years from 0000 to 9999, year 0000 being equal to 1 BC and all others AD. However, years prior to 1583 are not automatically allowed by the standard. Instead "values in the range [0000] through [1582] shall only be used by mutual agreement of the partners in information interchange."[10]
To represent years before 0000 or after 9999, the standard also permits the expansion of the year representation but only by prior agreement between the sender and the receiver.[11] An expanded year representation [±YYYYY] must have an agreed-upon number of extra year digits beyond the four-digit minimum, and it must be prefixed with a + or − sign[12] instead of the more common AD/BC (or CE/BCE) notation; by convention 1 BC is labelled +0000, 2 BC is labeled −0001, and so on.[13]


  1. There needs to be prior agreement.
  2. There needs to be a function to display March 15, 44 BCE when given -0044-03-15 (or -00440315) as input.
  3. This should be done so that both
a. columns are sortable
b. dates are readable by historians, grade 6 students, and other laypeople.

(I've also posted this in "Wikipedia talk:Manual of Style/Dates and numbers/Date autoformatting", because what they say should correspond with what is made available here.) (talk) 19:45, 6 August 2017 (UTC)

The {{Dts}} template creates a hidden sort key, which allows dates to be sorted in chronological order. As an example, the year 204 BC sorts in the same order as if it were -204. I haven't tested what would happen if you said the year was 0. The appearance of the date in the table can be selected from several formats.
What the Dts template does not allow for is Julian vs Gregorian calendar. So people creating a table would have to do one of three things:
  1. Express all the dates in the Julian calendar.
  2. Express all the dates in the Gregorian calendar;
  3. Make sure none of the Julian or Gregorian dates are close enough that the order would come out wrong.
The lack of support for the Julian calendar also means the year functions described on this page are not reliable for computing the time between two dates if either or both of the dates are Julian.
As for BC vs BCE, see WP:ERA.
As for the idea that ISO 8601 requires agreement among the communication partners to use dates before 1583, this is why Wikipedia does not use the YYYY-MM-DD format for dates before 1583. We also don't use the YYYY-MM-DD format for Julian calendar dates. These formats could (but don't need to be) used with the Dts template, as long as their changed to a different format for display to the reader if they are Julian or before 1583. Jc3s5h (talk) 20:56, 6 August 2017 (UTC)

now - 1 month on the 31st of July[edit]

One feature of the function doesn't work properly : the now - 1 month seems to substract 30 days to the 31st of July instead of a month. For example, today the 31st of July :

{{#time: j F Y|31 July 2018}} gives 31 July 2018

{{#time: j F Y|31 July 2018 -1 month}} gives 1 July 2018

Is there a way to solve this problem ? --Ptitmouk (talk) 12:25, 31 July 2018 (UTC)