Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 18095

One day difference in Converting Gregorian to Hijri date using Intl.DateTimeFormat

$
0
0

I am trying to convert Gregorian to Hijri date using Intl.DateTimeFormat, But every time it converts one day ahead. For example today is 11 Ramadan but every time it results in 12 Ramadan.

I have tried all calendar types "islamic, islamic-umalqura, islamic-civil, islamic-rgsa" I have also tried to change locale "PK, IN, AF, SA" but no difference. Is that a bug or I am doing something wrong.

console.log(new Intl.DateTimeFormat('en-PK-u-ca-islamic', {day: 'numeric', month: 'long',weekday: 'long',year : 'numeric'}).format(Date.now()))

Viewing all articles
Browse latest Browse all 18095

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>