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

247
Visualizações
How to Convert Persian (Jalali) Dates to other 18 Calendar Dates in Javascript without External Libraries or Complex Astronomical Equations

TL;DR, The requirement is to be able to take a Persian (Jalali) date (also known as Persian Solar Hijri Calendar) like Esfand 19, 1400 (i.e. "12/19/1400" and convert it to other calendars (Gregorian, Islamic, Chinese, Hebrew, etc.) without using external libraries or complex Astronomical Equations. And without using the pending implementation of the new date Temporal API into Javascript.

Javascript built-in method Intl.DateTimeFormat() converts Gregorian Dates into various calendars' dates (18 World Calendars) including the formatting of the output string.

However, as of today (March 2022), Javascript does not provide a built-in method for the reverse operation, i.e. converting the Persian Dates (and other calendars' dates) back into Gregorian Dates or into other calendars. For such purposes, you will need to use External Date Libraries to do the conversion such as 'moment.js' and many others.

My method of doing the date conversion follows as an answer to this question as recommended by StackOverflow here: Can I answer my own question?

over 4 years ago · Santiago Trujillo
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