Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

293
Views
Diferencia entre la fecha en JavaScript: cuántas horas entre la nueva fecha () y la nueva fecha (unix_time_stamp)

Tengo la siguiente respuesta de la base de datos:

 { "createdAt": "1634413505432" }

Quiero convertir esta timestamp de tiempo a algo así como 1 hour ago 7 sec ago 2 weeks ago según la fecha actual ( new Date() ). Entonces, traté de obtener la diferencia entre las dos fechas, pero parece que no funciona. tal vez lo estoy haciendo mal.

 Date.now() - 1634414179357 # i get 370517 new Date(370517 * 1000).getHours() # i get 8 which is wrong

¿Puede alguien mostrarme cómo hacer esto?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!