[Vuejs]-How to convert datesrting to short date object in javascript?

0👍

you can do it using Date object but there’s many lines to do that.

I handle all my date formatting with moment.

e.g.
moment(‘2021-02-28 00:00:00’).format(‘DD MMM YYYY hh:mm:ss’)

console.log(moment('2021-02-28 00:00:00').format('DD MMM YYYY HH:mm:ss'))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>

Leave a comment