Home
Random
Log in
Settings
About the Deadlock Wiki
Search
Editing
Module:Date
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" } function p.format_date(date_string) -- Split the date string into month, day, and year local month, day, year = date_string:match("(%d%d)-(%d%d)-(%d%d%d%d)") if month and day and year then -- Convert month number to month name local month_name = months[tonumber(month)] -- Convert day (removing leading zero if needed) local day_num = tonumber(day) -- Return formatted date return string.format("%s %d, %s", month_name, day_num, year) else -- Return the original string if the format doesn't match return date_string end end return p
Summary:
Please note that all contributions to Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Deadlock:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Template used on this page:
Module:Date/doc
(
edit
)