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

187
Vistas
How To campare date and check if is in future or past

i have a date formated as 3/13/2022 05:44 PM how to compare this date with the other dates which is formated in this manner and checks whether it is in past or future

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

0

Ohkay, so you need to compare the two dates and find which is latest, that is past or future..

So, you can just convert the dates to milliseconds using the Date.parse() function. This will parses a date string and returns the number of milliseconds since midnight January 1, 1970.

And then compare the two numbers accordingly.. For example:

<p id="demo"></p>

<script>
let ms = Date.parse("3/13/2022 05:47 PM");
let ns = Date.parse("3/13/2022 04:47 AM");
if(ms > ns){
document.getElementById("demo").innerHTML = "3/13/2022 05:47 PM is Future";
}else{
document.getElementById("demo").innerHTML = "3/13/2022 04:47 AM is Future";
}
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