I’m trying to format the date created into dd/mm/yyyy but the date is still displaying as mm/dd/yyyy.
The code I am using is
console.log ("original date = " + item._createdDate)
console.log ("formatted date = " + item._createdDate.toLocaleDateString('en-GB'))
The results are
original date = Fri Nov 15 2019 10:05:32 GMT+0000 (Coordinated Universal Time)
formatted date = 11/15/2019
original date = Wed Nov 13 2019 19:47:24 GMT+0000 (Coordinated Universal Time)
formatted date = 11/13/2019
I have checked region settings and they are UK with dd/mm/yyyy.
Could someone please help.