[cmd] EventTime
stableDescription
Gets the time of an event for custom reports.
CC_EventTime(Time())
HaasScript
-- Author: Strooth
-- Feel free to donate to support my work or if my script helped you in any way <3
-- BTC Adress: 33MsEAbA8tg7SpohgnCpSrmPTBih2UkhxQ
DefineCommand("EventTime", "format a timestamp from an event as day/month/year hours:minutes")
local eventtime = function(t)
local ad0 = function(i)
return IfElse(i > 9, i, '0'..Parse(i, StringType))
end
return ad0(CurrentDate(t))..'-'..ad0(CurrentMonth(t))..'-'..ad0(CurrentYear(t))..' '..ad0(CurrentHour(t))..':'..ad0(CurrentMinute(t))
end
DefineOutput(StringType, eventtime(DefineParameter(NumberType, 'time', 'the time to format', true, Time(), 'Time(), CreateTimestamp()')), "the formatted string", "StringType")
0 Comments
Sign in to leave a comment.
No comments yet. Be the first!