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

169
Vistas
Chrome Extension date and time not updated when extension working

I am making extension. I get date and time with "getDateAndTime();" function.

function getDateAndTime() {
return (date.getDate()<10? "0" : "") + date.getDate() + " " + months_tr[date.getMonth()] + " " + date.getFullYear() + " - " + (date.getHours()<10? "0" : "") + date.getHours() + "." + (date.getMinutes()<10? "0" : "") + date.getMinutes(); 
}

The first time the extension runs, the date and time are updated, but then when the function is called again, the data is not updated.

How can I keep the date and time up to date?

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

0

You have a date variable that declared out of the function. It's declared once so it will remain the same.

I guess you want to add:

function getDateAndTime() {
    const date = new Date();
    ....
}

It means that the date is updated for everyone calls this function.

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