summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarter Kolwey <cheapiephp@gmail.com>2016-01-02 01:13:38 -0600
committerCarter Kolwey <cheapiephp@gmail.com>2016-01-02 01:13:38 -0600
commit35b647ed4a885e0aadcbd6e07e63a1a401566f91 (patch)
tree0eb1fa3a1d5b742aef5f41780dcea51d11449219
parenteab09b9d73ac4be43567e03f23004a9628fd3e80 (diff)
downloadmesecons-35b647ed4a885e0aadcbd6e07e63a1a401566f91.tar
mesecons-35b647ed4a885e0aadcbd6e07e63a1a401566f91.tar.gz
mesecons-35b647ed4a885e0aadcbd6e07e63a1a401566f91.tar.bz2
mesecons-35b647ed4a885e0aadcbd6e07e63a1a401566f91.tar.xz
mesecons-35b647ed4a885e0aadcbd6e07e63a1a401566f91.zip
Add os.datetable(), a (very) limited wrapper for os.date(). Fixes #246.
-rw-r--r--mesecons_luacontroller/init.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua
index bbbd280..839d150 100644
--- a/mesecons_luacontroller/init.lua
+++ b/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