How to get current time in MikroTik RouterOS script

In order to get the current time in RouterOS, use

routeros_get_time.txt
/system clock get time

The time returned will be in hh:mm:dd format and local time

For example, the following command will print the current time:

example.txt
:put [/system clock get time]

 


Check out similar posts by category: MikroTik, Networking