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

196
Visualizações
moment.js always returns 0 for minutes()

I am trying to convert a moment into local time. However, when I try to get the minutes value from the moment it returns 0 even though it clearly is not 0 as can be seen from the picture the minutes is actually 35. Likewise, even if I do not try to get the minutes and format it to local time the minutes are again set to 0. In the example below 12:00 PM gets returned. What am I doing wrong and how do I correctly get the minutes portion of the moment or just as good how do I format it to local time with out the minutes being set to 0?

enter image description here

EDIT As suggested in the comments formatting like console.log(m.local().format('hh:mm')) does not have any effect the min are still disregarded. See image.

Also, I'm using version "moment": "^2.29.3"

enter image description here

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