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

142
Visualizações
Get Date pattern from date string in JS

I have been searching for a library in JS where I get the output as date format pattern ('yyyy-mm-dd' or 'dd-mm-yyyy' or so on..) from a date as input. the date could be in string format or UNIX. i.e if we paas date in some dateFormat('2021-08-14') function then output would be yyyy-mm-dd or so on.

If anyone has any idea about this then please let me know I know I can achieve this with regex but I want a build library in JS. Thanks in advance

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

0

momentjs was the most popular for this but is no longer maintained, https://day.js.org/ or https://date-fns.org/ are good alternatives.

about 4 years ago · Juan Pablo Isaza Relatório

0

The Date prototype has a good function for this: Date.prototype.toDateString
If you create an instance of Date, then you can call toDateString on it, and you have your

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