how to change from number to date.
instead of 7 i want to change it to JUL with big letter JUL.
pls help
:log info [:tostr ([:find [:toarray "jan,feb,mar,apr,may,jun,jul,ago,sep,oct,nov,dec"] [:pick $date 0 3]]+2)]
:global num2month do={ :return [:pick "REXJANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC" ($1*3) (($1*3)+3)] }
:put [$num2month 7]
:global mon2MON do={ :local strin "janfebmaraprmayjunjulaugsepoctnovdec"; :local strcomp "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"; :return [:pick $strcomp [:find $strin $1 -1] ([:find $strin $1 -1]+3)] }
:put [$mon2MON "jul"]
:global mon2num do={ :return ([:find "rexjanfebmaraprmayjunjulaugsepoctnovdec" $1 -1] / 3) }
:put [$mon2num "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:Code: Select all: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:Code: Select all: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 numberCode: Select all:global Mon2num do={ :return ([:find "RexJanFebMarAprMayJunJulAgoSepOctNovDec" $1 -1] / 3) } :put [$Mon2num "Jul"]
:global getMounth do={ :return [:pick [/system clock get date] 0 3] }
:global mon2num do={ :return ([:find "rexjanfebmaraprmayjunjulaugsepoctnovdec" $1 -1] / 3) }
:global num2NEXTmonth do={ :return [:pick "REXFEBMARAPRMAYJUNJULAUGSEPOCTNOVDECJAN" ($1*3) (($1*3)+3)] }
:log info [$num2NEXTmonth [$mon2num [$getMounth]]]