0

i have json return value, like this :

"registration_date": "2015-08-31T17:00:00.000Z",

and in this is the code i already tried based on this (stackoverflow) link :

How to format Vuetify data table date column?

<td class="text-left">{{ new Date(form.registration_date).toLocaleDateString() }}</td>

but it gives me 'Invalid Date' on the screen,

i want to make the date format like this : 31/08/2015 17:00:00

can someone help me?

1 Answers1

1

you can use https://momentjs.com/

moment(form.registration_date).format('DD/MM/YYYY h:mm:ss')

To use the moment.js

npm install moment --save

after installing import it to the vue file that want to integrate.

like this: import moment from 'moment'

Renato Manalili
  • 480
  • 3
  • 8
  • thank you, i use moment as you suggest, now the date showed as the format but why the date become different ? from this : 2015-08-31T17:00:00.000Z become 01/09/2015 12:00:00 did you know ? – FaisalTanjungDotCom Dec 16 '19 at 03:54