Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

79
Vistas
convert js datetime to moment

I have this format of datetime currently stored in res.data[i].time:

2022-05-18T13:00:00.000Z

what I want to do is convert it to moment format. When i do this:

moment().toDate()

it gives me this:

Tue May 10 2022 13:00:00 GMT-0400 (Eastern Daylight Saving Time)

what I want to need to do is convert 2022-05-18T13:00:00.000Z to moment somehow. I tried:

moment().toDate(res.data[i].time)

but that doesn't work either. is there a way to do this?

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

If you want to use momentjs in any tag

<h3>{{  moment(res.data[i].time).format("DD.MM.YYYY")  }}</h3>

and returns to you (approximately today's date)

11.05.2022

to get acquainted with detailed formats:

momentJs all formats

about 4 years ago · Juan Pablo Isaza Denunciar

0

Just let whatever = moment(res.data[i].time) should instantiate the moment object with the time string provided. You can then do whatever you need from there.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Here is what Moment supports now.

moment("2010-10-20 4:30 +0000", "YYYY-MM-DD HH:mm Z"); // parsed as 4:30 UTC
moment('24/12/2019 09:15:00', "DD MM YYYY hh:mm:ss");
moment('24/12/2019 09:15:00', "DD MM YYYY hh:mm:ss", true);
.
.
.

See this doc -> https://momentjs.com/docs/

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda