← All text tools

Hijri Date Widget and Code Snippets for Websites

Get copy-paste code to show or convert Hijri dates in JavaScript, PHP, Python, C#, SQL Server and Excel, plus a small widget you can embed in a web page.

  • Free
  • No sign-up
  • Works on any device

About Hijri Date Widget and Code Snippets for Websites

Developers who need Hijri dates on a website or in a report usually search for the right library call. This page gives ready code for JavaScript, PHP, Python, C#, SQL Server and Excel or Google Sheets, filled in with your sample date, and a small widget that prints today's Hijri date in a page. The JavaScript and PHP examples use the Umm al-Qura calendar from the browser or ICU, the C# one uses UmAlQuraCalendar, and the spreadsheet formulas follow the tabular rule and were checked against 73,000 days. The comments show the expected result.

How to use Hijri Date Widget and Code Snippets for Websites

  1. Choose the language and enter a sample Gregorian date.
  2. Pick the calendar and the month-name language, then copy the code.
  3. Run it on your own data and compare with the result shown in the comments.

Why use this tool?

Also known as

Frequently asked questions

Which calendar do the snippets use?

JavaScript, PHP and C# use Umm al-Qura. The Excel formulas and SQL style 131 follow tabular rules that can differ by a day or two from Umm al-Qura.

Does the widget follow the sunset day change?

No. It changes the Hijri date at midnight, because a web page cannot know the local sunset time without extra data.

Why do the Python and C# snippets mention year limits?

Those libraries ship fixed tables that cover only some Hijri years. Check their documentation for the exact range before you use them on old or distant dates.

Is Hijri Date Widget and Code Snippets for Websites free?

Yes. Hijri Date Widget and Code Snippets for Websites on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.