This is not the best way how to do this, but I managed to use this:
:put [:totime ([/system clock get gmt-offset ] - (2147483647 * 2) - 2)]
For example, if you try this :put [:totime ([/system clock get gmt-offset ]] and get some strange value, then try this :put [:totime ([/system clock get gmt-offset ] - (2147483647 * 2) - 2)].
It looks like a signed/unsigned problem. Is the value of the timezone offset incorrectly returned as unsigned, or is the division operator incorrectly treating it as unsigned?
From a quick test, I’m seeing that the gmt-offset itself is returned as unsigned (or more accurately, as a “num” value).
Technically, RouterOS does not have a signed integer type. The “num” type values are 64 bit unsigned integers. “time” values however can be negative. IMHO, that’s the type this should be returned as in general. The fix strods provided does just that - convert the “signed” 64 bit integer into a time value that is negative if necessary.
43200: Wrong value, time zones +12:45 (New Zealand), +13:00 (New Zealand, Samoa and Tonga) and +14:00 exist (Kiribati).
Do not cost nothing use at least 24 hours…