简体   繁体   中英

Formatting date with moment js

I am using moment js in react, how can I format date like this [2022m12d23] and [2022m12] ?

Thanks

You could add square bracket between expected string for example [m] or [d]

The format as below

YYYY[m]MM[d]DD or YYYY[m]MM

Reference: https://momentjs.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM