Template talk:Years or months ago

Hi! I have an article that I would like to use this template on, but I need the output to just say "years" instead of "years ago". How would I go about doing that? I'd like to be able to put in the date a person was sentenced to death row and have the template say how long they've been on death row in years (or months and years). Bali88 (talk) 19:26, 3 July 2014 (UTC)
 * Hi ! I recently had the very same question.  Yes, it's 2 years since you posted your question, and I also note you've not been Wiki-editing in a year, but figured I'd answer as it may help others.  There is no way I can see to use this   template and tweak the output language (as one can do with say  ).  It would seem to be a good idea to allow this one day.  But, there is a way to do what you (and I) want to do, here's how:  One uses the   template. So, for example, if one wants to get the numeric difference from the current year to say 2011, one would use:




 * This will output the number followed by the word "years", eg: "13.586377615233383 years ago" – the number depending on what year it is currently. So, one can create "It's been 13.586377615233383 years ago since the event occurred..." and "They've now been on death-row for over 13.586377615233383 years ago."


 * If one wants just the numeric year value, one uses the  template.  So, for example, if one wants to get the numeric difference from the current year to 1975, one would use:




 * This will output just the number "49" depending on what year it is currently. Maybe for use in something like, "Changes are still been observed during year 49 of its evolution."  One must add the month and day dates (in this case "1|1" for Jan 1st), the year will adjust accordingly.


 * Back to .  One can set parameters to spell out the numeric year value and/or to change the time-period magnitude.  For example:




 * Which will give: "She won the medal 13.586377615233383 years ago ago."


 * By mixing methods one can produce: "It was been 11 relatively quiet years since the big eruption, although 13.586377615233383 years ago of constant small earthquakes suggest to geologists that the activities are not over."


 * There is a second way to just output the year number, and a reason one may wish to use it. One uses the   Wiki-Variable along with the   Calculation template.  So, for example, if one wants to get the numeric difference from the current year back to 1492, one would use:




 * This will output just the number "'" depending on what year it is currently. Maybe for use in something like, "Columbus sailed the ocean blue  long years ago."  One does not include the month or day using this method. The reason to use this method is if one wishes to output the years as the equivalent words in English. There is a Wikipedia template designed to do this,  .  But, I found it cannot parse the output of the   template (it gives an "Invalid decimal numeral" error).  It will parse   outputs though.  So, one can produce this: "Columbus sailed the ocean blue ' long years ago."


 * I hope this helps, either you or others. Regards. – 71.236.191.197 (talk) 03:48, 5 June 2016 (UTC)


 * Go-next-red.svg  UPDATE:   Looks as if there is a third way to accomplish this, one can use the Wiki Module  .  But do note that it is still in beta-test.  Here, one can use the original   template.  The module pulls out only the years value.




 * So, when the default output is: "'", the module's modified output is just "'". Or, for closer time periods:




 * When the default output is: "'", the module's modified output is just "'".


 * All these methods can also produce Ordinal numeric output such as "first", "twentieth", "one-hundrend and forty second" when used with the  template. An example would be:




 * Where one could produce something such as: "In the year of her reign, the Queen..." Or with other values: "Now, in the  year of his incarceration, he..."


 * Regards. – 71.236.191.197 (talk) 23:29, 5 June 2016 (UTC)

Why is this template's input limited to years and months?
It would be nice to be able to use this template in running text in articles when a full date is known, generating something like:

The New York Times was founded 171 years ago, on September 18, 1851." (for example)

Might this be a future possibility? Thanks! 1980fast (talk) 00:20, 5 July 2023 (UTC)