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

246
Vistas
How to set expiry time to 30 mins in javascript?
const check=()=>{
   const cacheIntervalInMin = 1;
   const cacheExpiryTime = new Date();
   cacheExpiryTime.setMinutes(cacheExpiryTime.getMinutes() + cacheIntervalInMin);
 

   const lastRequest = new Date().toISOString();
   let a= new Date(lastRequest);
   if(a>cacheExpiryTime){ 
       console.log(Expired')
   }
   else console.log('Not expired');
}
check();
  

I want to set the expiry time to 30 mins but everytime I call this function it is always false . a never becomes greater than expiry time. How to solve this? How to achieve this?

about 4 years ago · Juan Pablo Isaza
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