Home
Random
Log in
Settings
About the Honkai: Nexus Anima Wiki
Disclaimers
Search
Editing
Template
:
Time Ago/doc
Warning:
You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more
.
Log in
or
create an account
to continue receiving notifications after this account expires, and to access other features.
Anti-spam check. Do
not
fill this in!
{{Documentation/Header}} {{Lua|Time Ago}} Get the time since or time until a date. ==Syntax== If the time is lower than the last date unit specified, the next valid date unit will be shown instead.<br> {{T|Time Ago|v1=date|v2=last=last date unit to display|v3=include=comma list of the date units to display|v4=hidelabel=show number only and hide label text}} * Date units accepted: ** ''y'' or ''year'' — display up to years ** ''mth'' or ''month'' — display up to months ** ''w'' or ''week'' — display up to weeks ** ''d'' or ''day'' — display up to days ** ''h'' or ''hour'' — display up to hours ** ''min'' or ''minute'' — display up to minutes ** blank — displays up to seconds * '''include''' — takes priority over '''last''', enter a comma list of valid date units to display * '''last''' — defaults to blank. * '''lowercase''' — lowercase output. ==Examples== ;Basic Function {{T|Time Ago|2025-12-23|p2=last=w|_Y_=1}}<br> {{T|Time Ago|2025-12-23|p2=last=y|_Y_=1}}<br> {{T|Time Ago|2020-12-23|p2=last=d|_Y_=1}}<br> {{T|Time Ago|2019-12-23|p2=last=month|_Y_=1}}<br> ;Pick and Choose units {{T|Time Ago|2019-12-23|p2=include=y,mth,d|_Y_=1}}<br> {{T|Time Ago|2019-12-23|p2=include=mth|_Y_=1}}<br> {{T|Time Ago|2022-08-22|p2=include=y,mth,d|_Y_=1}}<br> ;No Labels {{T|Time Ago|2020-09-28|p2=hidelabel=1|_Y_=1}}<br> {{T|Time Ago|2020-09-28|p2=last=year|p3=hidelabel=1|_Y_=1}} ;Lowercase {{T|Time Ago|2050-09-28|p2=last=y|p3=lowercase=1|_Y_=1}} ==Template Data== <templatedata> { "params": { "1": { "label": "Date", "description": "Datetime to display.", "type": "date", "required": true }, "last": { "label": "Last Unit", "description": "Smallest unit of time to display down to.", "example": "\"y\", \"mth\", \"w\", \"d\", \"h\", \"min\", \"\"", "type": "string", "suggested": true }, "include": { "label": "Units to Include", "description": "Comma list of unit(s) of time to display.", "example": "\"y, mth, h\", \"w, min\"", "type": "string", "suggested": true }, "hidelabel": { "label": "Hide Label", "description": "Set to \"1\" to remove \"In\", \"ago\", and time unit text.", "example": "1", "type": "boolean" }, "lowercase": { "label": "Lowercase Output", "description": "Set to \"1\" to have lowercase \"in\".", "example": "1", "type": "boolean" } }, "description": "Get the time since or time until a date.", "paramOrder": [ "1", "last", "include", "hidelabel", "lowercase" ], "format": "inline" } </templatedata>
Summary:
Please note that all contributions to Honkai: Nexus Anima Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Honkai Nexus Anima Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, 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.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Below are commonly used wikitext from
MediaWiki:Edittools
. Click on any to insert them in the edit box.
Dynamic Page List
:
¦
²
«
»
²{¦}²
«»
«/»
«!----»
Array in DPL
:
¹
^2{
}^2
^2{¹}^2
Parser Functions
:
{{#if:||}}
{{#if:<condition>|<result if true>|<result if false>}}
{{#ifeq:|||}}
{{#ifeq:<text1>|<text2>|<result if text1=text2>|<result if text1≠text2>}}
{{#expr:}}
{{#expr:<mathematical expression>}}
{{#switch:||#default=}}
{{#switch:<text1>|<text2>=<result if text1=text2>|<text3>=<result if text1=text3>|#default=<result if no valid match>}}
{{#replace:||}}
{{#replace:<text1>|<plain text to find in text1>|<plain text to insert in place of the text found>}}
{{#titleparts:}}
{{#replace:<page name>}}
{{#tag:|}}
{{#tag:<name of html tag>|<content inside html tag>}}
Markup:
{{}}
|
[]
[[]]
[[Category:]]
#REDIRECT [[]] [[Category:Redirect Pages]]
<code></code>
<includeonly></includeonly>
<noinclude></noinclude>
<nowiki></nowiki>
<!---->
<br>
§
Notices:
{{Stub|}}
{{Stub Dialogue}}
{{Upcoming}}
{{Under Construction}}
{{Placeholder Image|}}
Magic Words
:
{{!}}
{{formatnum:}}
{{lc:}}
{{uc:}}
{{PAGENAME}}
{{FULLPAGENAME}}
{{ROOTPAGENAME}}
{{BASEPAGENAME}}
{{SUBPAGENAME}}
{{DISPLAYTITLE:|noreplace}}
__TOC__
__NOTOC__
__EXPECTUNUSEDCATEGORY__
__HIDDENCAT__
References:
<ref></ref>
{{Reflist}}
{{Ref/Arti|}}
{{Ref/ArtiSet|}}
{{Ref/BB|}}
{{Ref/Book|}}
{{Ref/CS|}}
{{Ref/Companion|}}
{{Ref/Domain|}}
{{Ref/Enemy|}}
{{Ref/Food|}}
{{Ref/Furnishing|}}
{{Ref/HEO|}}
{{Ref/Item|}}
{{Ref/Loading|}}
{{Ref/Location|}}
{{Ref/Manga|}}
{{Ref/NPC|}}
{{Ref/Outfit|}}
{{Ref/Quest|}}
{{Ref/Talent|}}
{{Ref/VO|}}
{{Ref/VP|}}
{{Ref/Weapon|}}
{{Ref/Wildlife|}}
HTML Entities:
—
,
­
Pages included on this page:
Template:Documentation/Header
(
edit
)
Template:Lua
(
edit
)
Template:MessageBox
(
edit
)
Template:Namespace
(
edit
)
Template:T
(
view source
) (fully protected)
Template:Time Ago
(
edit
)
Module:Arguments
(
view source
) (fully protected)
Module:Arguments/i18n
(
view source
) (fully protected)
Module:Common/i18n
(
view source
) (fully protected)
Module:Config
(
view source
) (fully protected)
Module:Documentation
(
view source
) (fully protected)
Module:Documentation/config
(
view source
) (fully protected)
Module:Documentation/i18n
(
view source
) (fully protected)
Module:Entrypoint
(
view source
) (fully protected)
Module:Exists
(
view source
) (fully protected)
Module:Fallbacklist
(
view source
) (fully protected)
Module:Feature
(
view source
) (fully protected)
Module:Formatting
(
view source
) (fully protected)
Module:I18n
(
view source
) (fully protected)
Module:Languages
(
view source
) (fully protected)
Module:Mbox
(
view source
) (fully protected)
Module:Mbox/i18n
(
view source
) (fully protected)
Module:Namespace detect
(
view source
) (fully protected)
Module:Namespace detect/config
(
view source
) (fully protected)
Module:Namespace detect/data
(
view source
) (fully protected)
Module:TableTools
(
view source
) (fully protected)
Module:Time Ago
(
view source
) (fully protected)
Module:Time Ago/i18n
(
edit
)
Module:Yesno
(
view source
) (fully protected)