Module:Date: Difference between revisionsGive feedback
initial |
m input date format from mm-dd-yyyy -> yyyy-mm-dd |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 6: | Line 6: | ||
} | } | ||
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 | ||