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

291
Visualizações
Axios request returning 'invalid date' in React but API response in network calls returns date string

I am trying to fetch data from an api. Everything returns as it should when I look in the network call but when I run console.log(response), 'dateModified' shows as 'Invalid Date' even though the network call is fine. Does axios automatically try to convert the date string into a date object or is something else happening? I see no reason why it would be fine on the network call but not when I console.log or try to use the value

Ex: Axios call:

axios.get('/apihere').then((response) => {
  console.log(response)
}

returns:

Object {
    dateModified: Invalid Date
  }

which has an option to expand and show " Date.prototype {...}"

Network call:

Object {
    dateModified: "06/02/2022"
  }
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