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

292
Vistas
Moment js: What is the different between moment(date:string, format:string) to moment(date:string).format(format:string)?

I want to know what is the different between:

moment('2021-12-12', 'YYYY-MM-DD')

to this one:

moment('2021-12-12).format('YYYY-MM-DD)

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

0

When you use the format method in moment, you convert the date to the string with the desired format. But when you pass the desired format as the second argument to the moment method, you do not actually convert the data type. But you want that your date to be in a written format. This is a big difference between first option and second option that you wrote.

For more info you can read this

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