Module:Format time/doc

This is the current revision of this page, as edited by HouseBlaster (talk | contribs) at 04:08, 28 June 2025 (create doc). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

This module is a fancy way to call {{#time}} in Lua. Unlike #time, it handles YMD dates (e.g. 2020 January 1) correctly via Module:YMD to ISO.

Syntax

edit

From a template:

{{#invoke:Format date|main|1='<timestamp>'|fmt='<Formatting string>'}}

From a module:

require('Module:Format time')._main{<timestamp>, fmt = <Formatting string>}

In both cases, <timestamp> is any timestamp considered valid by {{#time}} in addition to YMD format. |fmt= can be any format according to mw:Help:Extension:ParserFunctions##time, and defaults to j xg Y, which renders dates like 28 June 2025.