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

668
Vistas
Javascript date format inside NestJs

I have a ScrapeResult mikroOrm entity, I am trying to create a new Date by using this piece of code newScrapeResult.date = new Date() and I am getting 2022-07-17T17:07:24.494Z this output.

I need to convert the above format to yyyy-mm-dd hh mm ss this format. How can I do this? I will save this format to database.

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

This might help you

function currentTime() {
    let date = new Date()
    let a = date.getFullYear()
    let b = date.getMonth()+1 // JS months are 0 indexed, 0 = January, 11 = December
    let c = date.getDate()

    let d = date.getHours()
    let e = date.getMinutes()
    let f = date.getSeconds()

    return a+'-'+b+'-'+c+' '+d+' '+e+' '+f
}
console.log(currentTime())
about 4 years ago · Santiago Gelvez 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