Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

243
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda