localp={}-- There's probably a way to use strptime or some other more sophisticated way, but you're not supposed to be using a non-timestamp as input anyway.localfunctionendswith(String,End)returnEnd==''orstring.sub(String,-string.len(End))==Endendlocalfunctiontrim(s)returns:gsub("^%s+",""):gsub("%s+$",""):gsub("\226\128\142","")endlocalfunctionaddUtcToStringIfItDoesNotEndWithUtc(s)ifs==""orendswith(s,"~~~~")thenreturnsendifnotendswith(s,"(UTC)")thenreturns.." (UTC)"endreturnsendlocalfunction_main(args)localhopefullyTimestamp=args[1]oros.date('%H:%M, %d %B %Y (%Z)')returnaddUtcToStringIfItDoesNotEndWithUtc(trim(hopefullyTimestamp))endfunctionp.main(frame)localargsiftype(frame.args)=='table'then-- We're being called via #invoke. The args are passed through to the module-- from the template page, so use the args that were passed into the template.args=frame.argselse-- We're being called from another module or from the debug console, so assume-- the args are passed in directly.args=frameendreturn_main(args)endreturnp