Necesito cambiar el formato de 2022-12-30 a 30-12-2022 (DD/MM/YYYY)
Pero necesito mantenerlo como objeto FECHA , no como cadena
Aquí lo que he intentado:
obj.created_at // return string 2022-12-30 (YYYY-MM-DD) new Date(obj.created_at) // return date 12/30/2022 (MM/DD/YYYY) new Date(obj.created_at).toLocaleDateString('id-ID') // return string 30/12/2022 (DD/MM/YYYY), this is the correct format, but it's a string not a date moment(obj.created_at).toDate() // return date 12/30/2022 (MM/DD/YYYY) moment(obj.created_at).format('DD/MM/YYYY') // return string 30/12/2022 (DD/MM/YYYY), this is the correct format, but it's a string not a date moment(obj.created_at, 'YYYY-MM-DD').toDate() // return date 12/30/2022 (MM/DD/YYYY)Gracias :)