Genshin Impact Wiki
Advertisement
Genshin Impact Wiki
Documentation icon Template documentation
Note: parts of or the entire template might not be visible without values provided.
Lua logo
This template uses Module:Time Ago (edit | hist), a script written in Lua.

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.
{{Time Ago|date|last = last date unit to display|include = comma list of the date units to display|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

{{Time Ago|2025-12-23|last = w}} yields: In 1 year, 3 months
{{Time Ago|2025-12-23|last = y}} yields: In 1 year
{{Time Ago|2020-12-23|last = d}} yields: 3 years, 8 months, 4 weeks ago
{{Time Ago|2019-12-23|last = month}} yields: 4 years, 8 months ago

Pick and Choose units

{{Time Ago|2019-12-23|include = y,mth,d}} yields: 4 years, 8 months, 29 days ago
{{Time Ago|2019-12-23|include = mth}} yields: 56 months ago
{{Time Ago|2022-08-22|include = y,mth,d}} yields: 2 years, 30 days ago

No Labels

{{Time Ago|2020-09-28|hidelabel = 1}} yields: 3, 11, 3, 2, 5, 9, 8
{{Time Ago|2020-09-28|last = year|hidelabel = 1}} yields: 3

Lowercase

{{Time Ago|2050-09-28|last = y|lowercase = 1}} yields: in 26 years

Template Data

Get the time since or time until a date.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Date1

Datetime to display.

Daterequired
Last Unitlast

Smallest unit of time to display down to.

Example
"y", "mth", "w", "d", "h", "min", ""
Stringsuggested
Units to Includeinclude

Comma list of unit(s) of time to display.

Example
"y, mth, h", "w, min"
Stringsuggested
Hide Labelhidelabel

Set to "1" to remove "In", "ago", and time unit text.

Example
1
Booleanoptional
Lowercase Outputlowercase

Set to "1" to have lowercase "in".

Example
1
Booleanoptional
Advertisement