Advertisement
phukao_itm

func_LINEdateTime (for ROS v7.10++)

Jun 16th, 2023
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ###################################################################
  2. #
  3. # FOR ROUTER OS v7.10 (later)
  4. #
  5. # Return MMM d, YYYY, H:M:s
  6. #
  7. # Edit to support RouterOS v7.10
  8. # release: 16/06/2023
  9. # You should be save with name "func_LINEdateTime" in you router, or anyone else but edit in main script also
  10. #
  11. ####
  12.  
  13. :local date
  14. :local time
  15. :local monthr {"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov";"Dec"}
  16.  
  17.  
  18. :set date [/system clock get date]
  19. :set time [/system clock get time]
  20.  
  21. :local yy [:tostr [:pick $date 0 4]]
  22. :local dd [:tostr [:pick $date 8 10]]
  23. :local mm [:tonum [:pick $date 5 7]]
  24. :local mmStr "$[:pick $monthr ($mm-1)]"
  25.  
  26. # DD/MM/YY - HH:MM:SS
  27. # :set $res "$dd/$mm/$yy - $time"
  28.  
  29. # MMM DD, YY - HH:MM:SS
  30. :set $res "$mmStr $dd, $yy - $time"
  31.  
  32. :return $res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement