This convert all routeros datetime format to unix
:put [$datetime2epoch] no parameters = now
No matter the month case (not support absurd xxX, xXx or xXX format for maiusc.)
:put [$datetime2epoch “apr/13/2023 09:30:00”]
:put [$datetime2epoch “Apr/13/2023 09:30:00”]
:put [$datetime2epoch “APR/13/2023 09:30:00”]
:put [$datetime2epoch “apr/13 09:30:00”] (implicit current year, used on log and scheduler)
:put [$datetime2epoch “09:30:00”] (implicit current day/month/year, used on log and scheduler)
Added for compatibility with RouterOS v7.10+
:put [$datetime2epoch “2023-04-13 09:30:00”]
:put [$datetime2epoch “04-13 09:30:00”] (implicit current year, used on log and scheduler)
http://forum.mikrotik.com/t/calculate-the-difference-between-two-dates/162735/5
Convert unix time to datetime format?
http://forum.mikrotik.com/t/convert-uptime-to-date-and-time/157724/36
Just personalize the wanted output, easily a parameter can be added at the end to select the format.