Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Cambiar el formato de fecha del momento (obj.created_at).toDate()

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 :)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!