Module:Date: Difference between revisionsGive feedback
m format_date > p.format_date |
m input date format from mm-dd-yyyy -> yyyy-mm-dd |
||
| Line 7: | Line 7: | ||
function p.format_date(date_string) | function p.format_date(date_string) | ||
-- Split the date string | -- Split the date string | ||
local month, day | local year, month, day = date_string:match("(%d%d%d%d)-(%d%d)-(%d%d)") | ||
if month and day and year then | if month and day and year then | ||