From 59696c994acaf1926c1e4be75ea6563394a32f76 Mon Sep 17 00:00:00 2001 From: Norberto A <41595007+Limesey@users.noreply.github.com> Date: Tue, 3 Mar 2020 14:22:08 +0000 Subject: [PATCH] Time format fix Fixed setTimestamp() --- RoHook.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/RoHook.lua b/RoHook.lua index 2dc86a6..a3bd9f1 100644 --- a/RoHook.lua +++ b/RoHook.lua @@ -18,8 +18,15 @@ module.webhookConfig = { local function getDate() local date = os.date("!*t") - local str = string.format("%s-%s-%sT%s:%s:%s.000Z", date.year, date.month, date.day, date.hour, date.min, date.sec) + local function format(i) + if(string.len(i) == 1) then + return string.format("0%s", i) + else + return i + end + end + local str = string.format("%s-%s-%sT%s:%s:%s.000Z", date.year, date.month, date.day, format(date.hour), format(date.min), format(date.sec)) return str end