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

229
Visualizações
RNDateTimePicker change date format from MM/dd/yy to anything else

how can I change the display format of RNDateTimePicker?

Once click the date, the date picker will pop up, after select, the display date format is "MM/dd/yy". I want to change it to "dd/MM/yyyy" since it is the date format I use on the other screen. I cannot find the solution for now, even on the documentation.

Here the display date

<RNDateTimePicker
    mode="date"
    value={upTargetStartDate}
    minimumDate={new Date()}
    onChangeText={(text) => setUpTargetStartDate(text)}
/>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

According to the documentation, you need to add dateFormat property into your RNDateTimePicker component and pass your desire date's format which in your case is: day month year.

<RNDateTimePicker
  mode="date"
  dataFormat="day month year"    // --------> added here
  value={upTargetStartDate}  
  minimumDate={new Date()}
  onChangeText={(text) =>
  setUpTargetStartDate(text)
  }
/>

You can also change the format with simple javascript's methods:

const wrongFormat = "12/20/21"

const [month, day, year] = wrongFormat.split("/")

const correctFormat = `${day}/${month}/${year}`

console.log(correctFormat)

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