Skip to content

Commit

Permalink
Add os.datetable(), a (very) limited wrapper for os.date(). Fixes #246.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheapie committed Jan 2, 2016
1 parent eab09b9 commit 35b647e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mesecons_luacontroller/init.lua
Expand Up @@ -201,6 +201,10 @@ local function safe_print(param)
print(dump(param))
end

local function safe_date()
return(os.date("*t",os.time()))
end

local function remove_functions(x)
local tp = type(x)
if tp == "table" then
Expand Down Expand Up @@ -321,6 +325,7 @@ local function create_environment(pos, mem, event)
clock = os.clock,
difftime = os.difftime,
time = os.time,
datetable = safe_date,
},
}
env._G = env
Expand Down

0 comments on commit 35b647e

Please sign in to comment.