# changing from number to date

**URL:** <https://forum.mikrotik.com/t/changing-from-number-to-date/150050>\
**Category:** Scripting\
**Created:** [June 28, 2021, 12:37am UTC](https://forum.mikrotik.com/t/changing-from-number-to-date/150050 "2021-06-28T00:37:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![runbound](https://forum.mikrotik.com/letter_avatar/runbound/32/6_449c533f586939b6e5f246632a46421f.png) [@runbound](https://forum.mikrotik.com/u/runbound)\
**Post date:** [June 28, 2021, 1:42am UTC](https://forum.mikrotik.com/t/changing-from-number-to-date/150050/3 "2021-06-28T01:42:23Z")

</div>

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)] ($1_3) (($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:
> 
> ```plaintext
> :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:
> 
> ```plaintext
> :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
> 
> ```plaintext
> :global Mon2num do={ :return ([:find "RexJanFebMarAprMayJunJulAgoSepOctNovDec" $1 -1] / 3) }
> :put [$Mon2num "Jul"]
> 
> ```

---

_[View the full topic](https://forum.mikrotik.com/t/changing-from-number-to-date/150050)._
