Skip to content
Permalink
Browse files

Add os.datetable(), a (very) limited wrapper for os.date(). Fixes #246.

  • Loading branch information...
cheapie committed Jan 2, 2016
1 parent eab09b9 commit 35b647ed4a885e0aadcbd6e07e63a1a401566f91
Showing with 5 additions and 0 deletions.
  1. +5 −0 mesecons_luacontroller/init.lua
@@ -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
@@ -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

0 comments on commit 35b647e

Please sign in to comment.
You can’t perform that action at this time.