Jump to content
Toggle sidebar
NowMusic Wiki
Search
Create account
Personal tools
Create account
Log in
⧼⧽
Talk
Contributions
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information
Editing
Template:Age in days/doc
Template
Discussion
British English
Read
Edit source
View history
More
Read
Edit source
View history
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} {{Lua|Module:Age}} This template returns the number of days between two dates. Dates may be input either as full dates or as year, month and day. ==Usage== ====Full dates==== To use, type: :{| |- |<code><nowiki>{{age in days|date1|date2}}</nowiki></code> ||(number of days between dates 1 and 2), |- |<code><nowiki>{{age in days|date1}}</nowiki></code> ||(number of days since date 1) or |- |<code><nowiki>{{age in days||date2}}</nowiki></code> ||(number of days until date 2) |} Examples: :{| |- |<code><nowiki>{{age in days|19 Aug 2008|4 Sep 2010}}</nowiki></code> ||gives {{age in days|19 Aug 2008|4 Sep 2010}} |- |<code><nowiki>{{age in days|27 May 2002}}</nowiki></code> ||gives {{age in days|27 May 2002}} |- |<code><nowiki>{{age in days||{{#time:j M Y|+ 15 months}}}}</nowiki></code> ||gives {{age in days||{{#time:j M Y|+ 15 months}}}} |} ====Year, month and day==== To use, type: :{| |- |<code><nowiki>{{age in days|year1|month1|day1|year2|month2|day2}}</nowiki></code> ||(number of days between dates 1 and 2), |- |<code><nowiki>{{age in days|year1|month1|day1}}</nowiki></code> ||(number of days since date 1) or |- |<code><nowiki>{{age in days||||year2|month2|day2}}</nowiki></code> ||(number of day until date 2) |} Or with named parameters: :{| |- |<code><nowiki>{{age in days|month1= |day1= |year1= |month2= |day2= | year2= }}</nowiki></code> ||(number of days between dates 1 and 2), |- |<code><nowiki>{{age in days|month1= |day1= |year1= }}</nowiki></code> ||(number of days since date 1) or |- |<code><nowiki>{{age in days|month2= |day2= | year2= }}</nowiki></code> ||(number of day until date 2) |} Examples: {| |- |<code><nowiki>{{age in days|2007|5|24|2008|4|23}}</nowiki></code> ||gives {{age in days|2007|5|24|2008|4|23}} |- |<code><nowiki>{{age in days|2007|5|24}}</nowiki></code> ||gives {{age in days|2007|5|24}} |} ===Sorting=== By adding {{para|sortable|on}} a sort key will be added to the output for use in sortable tables. ===Formatting=== Three styles of formatting are possible. :{| |- |{{para|format|raw}} ||gives unformatted numbers with hyphens as minus signs<ref>Negative days will occur if the first date is after the second.</ref> (for use in further calculations). |- |{{para|format|commas}} ||gives numbers formatted with commas and true minus signs. |} For reasons of retrospective compatibility, the default when inputting dates as year, month and day is {{para|format|raw}}; however when inputting dates in full it is {{para|format|commas}}. :Note {{Reflist}} ===Showing the unit=== The default is not to show units. To show the unit ("day", days" or "d") use {{para|show unit}}. :{| |- |{{para|show unit|abbr}} ||adds "d" after the number of days. |- |{{para|show unit|full}} ||adds "day" or "days" after the number of days as appropriate. |} <!--==See also== * [[Wikipedia:Age calculation templates]] * {{tl|Duration in days}} * {{tl|Time ago}} -->
Summary:
Please note that all contributions to NowMusic Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
NowMusic Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Age in days
(
edit
)
Template:Documentation subpage
(
edit
)
Template:Lua
(
edit
)
Template:Mbox
(
edit
)
Template:Para
(
edit
)
Template:Reflist
(
edit
)
Template:Strong
(
edit
)
Template:Terminate sentence
(
edit
)
Module:Age
(
edit
)
Module:Arguments
(
edit
)
Module:Date
(
edit
)
Module:List
(
edit
)
Module:Lua banner
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:TableTools
(
edit
)
Module:Text
(
edit
)
Module:Yesno
(
edit
)