javascript - Convert date in YYYY/MM/DD format in MomentJS -
i using momentjs converting date format.
i have date in format 2010/12/01 , want convert 01/12/2010 using momentjs only.
i have date in format "12/02/2014" , want convert in "2014/12/02"
<!--begin snippet: js hide: false console: true babel: false--> <!--language: lang-js--> var date = moment(new date(2010/12/01)).format("mmm h/mm"); console.log(date); <!--language: lang-html--> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js"></script> <!--end snippet-->
how convert them using momentjs
you can try this:
moment('2010/12/01', 'yyyy/mm/dd').format('dd/mm/yyyy')
Comments
Post a Comment