Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

263
Visualizações
calculate difference in HH:mm between two different time in same date with javascript

I have two date fields with different time - INIT1 and END1. I need to populate a third field TTL1 with the difference in hours and minutes between these two date fields.

Then I have two other date fields with different time - INIT2 and END2 and I have to do the same thing with these. In the end I have to add the two differences, one of which could be zero, to get the total time in hours and minutes. I've tried several solutions with the examples found here, but they don't fulfill my need.

I am a newbie, be understanding, please...Thank you

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Do you already know the library "date-fns"? I think it can be useful for this case. I'm almost sure that this link can be the solution for your question.

https://date-fns.org/v2.28.0/docs/differenceInMinutes

(also, they have options for difference in seconds, hours, days and etc).

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda