There are only a few libraries in the Redis Lua sandbox, and os not one of them.
You can call Redis TIME from Lua, for example:
local t = redis.call('TIME')
However, you need to find a way to convert the era into the desired format, and also note that it will not allow you to execute a script entry (since this is not a deterministic command).
Update: With Redis v3.2, there is a new replication mode for effect-based scripts (not code-based). When using this mode, you can actually name all random, non-deterministic commands. See the EVAL page for more information.
Itamar haber
source share