Code: Select all
{
:local intGoff [:tonum [/system clock get gmt-offset]]
:if ($intGoff > 93600) do={:set intGoff ((4294967296 - $intGoff) * -1)}
:local epochNow (([/tool fetch url="https://showcase.api.linx.twenty57.net/UnixTime/tounix\3Fdate=now" as-value output=user])->"data")
:set epochNow [:pick $epochNow 1 ([:len $epochNow] - 1)]
:local upTime [/system resource get uptime]
:local wPos [:find $upTime "w" -1]
:local dPos [:find $upTime "d" -1]
:local utLen [:len $upTime]
:local utSec [:pick $upTime ($utLen - 2) $utLen]
:local utMin [:pick $upTime ($utLen - 5) ($utLen - 3)]
:local utHou [:pick $upTime ($utLen - 8) ($utLen - 6)]
:local utDay 0
:local utWee 0
:if (([:typeof $wPos] = "nil") and ([:typeof $dPos] = "num")) do={:set utDay [:pick $upTime 0 $dPos] }
:if (([:typeof $wPos] = "num") and ([:typeof $dPos] = "num")) do={:set utDay [:pick $upTime ($wPos + 1) $dPos] }
:if ([:typeof $wPos] = "num") do={:set utWee [:pick $upTime 0 $wPos] }
:local totUtSec ($utSec + (60 * $utMin) + (60 * 60 * $utHou) + (60 * 60 * 24 * $utDay) + (60 * 60 * 24 * 7 * $utWee))
:local epochStart ($epochNow - $totUtSec + $intGoff)
:local datetimeStart (([/tool fetch url="https://showcase.api.linx.twenty57.net/UnixTime/fromunix\3Ftimestamp=$epochStart" as-value output=user])->"data")
:set datetimeStart [:pick $datetimeStart 1 ([:len $datetimeStart] - 1)]
:put "RouterBOARD is started $datetimeStart"
}
EL DONCITO.