thanks sir. i forgot to insert the pick date
:local Date [/system clock get date]
:global num2month do={ :return [:pick "REXJANFEBMARAPRMAYJUNJULAGOSEPOCTNOVDEC" [:pick $Date 0 3]+1)] ($13) (($1 3)+3)] }
:log info [$num2month]
today is JUN but i need to get the JUL
search tag # rextended num2month Mon2MON Mon2num number month
Can be used various method, but you suggest me some new...
Numerical Month to 3 uppercase month letters:
:global num2month do={ :return [:pick "REXJANFEBMARAPRMAYJUNJULAGOSEPOCTNOVDEC" ($1*3) (($1*3)+3)] }
:put [$num2month 7]
if on your confusion request you mean how change Jul to JUL (suggested from :pick $date 0 3)...
Convert from 3 month letters to 3 uppercase month letters:
:global Mon2MON do={ :local strin "JanFebMarAprMayJunJulAgoSepOctNovDec"; :local strcomp "JANFEBMARAPRMAYJUNJULAGOSEPOCTNOVDEC"; :return [:pick $strcomp [:find $strin $1 -1] ([:find $strin $1 -1]+3)] }
:put [$Mon2MON "Jul"]
And this extra..
Convert from MikroTik 3 month letters (from date) to number
:global Mon2num do={ :return ([:find "RexJanFebMarAprMayJunJulAgoSepOctNovDec" $1 -1] / 3) }
:put [$Mon2num "Jul"]