Module:SignatureDateConvert
Jump to navigation
Jump to search
![]() | This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected. |
Usage
This module is used for converting dates that are in signatures to YYYY-MM-DD, so they can be used sort-ably in tables.
Example
{{#invoke:SignatureDateConvert|sigConv|timestamp=02:19, 7 March 2021 (UTC)}}
2021-03-7
Current uses
See {{SigTableSort}}.
local p = {}
function p.sigConv(frame)
s = frame.args.timestamp
r="(%d+):(%d+), (%d+) (%a+) (%d+) %(UTC%)"
hour,min,day,month,year=s:match(r)
MON={January="01",February="02",March="03",April="04",May="05",June="06",July="07",August="08",September="09",October="10",November="11",December="12"}
month=MON[month]
return year .. "-" .. month .. "-" .. day
end
return p