forked from Mirrorlandia_minetest/mesecons
Add os.datetable(), a (very) limited wrapper for os.date(). Fixes #246.
This commit is contained in:
parent
eab09b9d73
commit
35b647ed4a
@ -201,6 +201,10 @@ local function safe_print(param)
|
|||||||
print(dump(param))
|
print(dump(param))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function safe_date()
|
||||||
|
return(os.date("*t",os.time()))
|
||||||
|
end
|
||||||
|
|
||||||
local function remove_functions(x)
|
local function remove_functions(x)
|
||||||
local tp = type(x)
|
local tp = type(x)
|
||||||
if tp == "table" then
|
if tp == "table" then
|
||||||
@ -321,6 +325,7 @@ local function create_environment(pos, mem, event)
|
|||||||
clock = os.clock,
|
clock = os.clock,
|
||||||
difftime = os.difftime,
|
difftime = os.difftime,
|
||||||
time = os.time,
|
time = os.time,
|
||||||
|
datetable = safe_date,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
env._G = env
|
env._G = env
|
||||||
|
Loading…
Reference in New Issue
Block a user