Understanding the Islamic Date Today A Guide to Converting Gregorian Dates to Hijri Using Power Apps

Understanding the Islamic Date Today: A Guide to Converting Gregorian Dates to Hijri Using Power Apps

 

What is the Islamic Date Today? Converting Gregorian Dates to Hijri

Have you ever wondered, “What is the Islamic date today?” With the increasing need for global communication and interaction, understanding and converting between various calendar systems is vital. This blog post is dedicated to elucidating the process of converting Gregorian dates to Islamic Hijri dates using Power Apps.

It’s a known fact that Power Apps doesn’t come with an inbuilt function for this task. This is especially challenging since other Microsoft tools, like Excel, offer substantial support for the Hijri calendar. However, not all hope is lost. There is a straightforward method available to carry out this conversion with minimal coding knowledge.

The Challenge in Formula Conversion

Generating a formula to convert Gregorian dates to Hijri isn’t easy. While many might reference algorithms on platforms like StackOverflow, implementing them in a low-code environment can be a daunting task.

Conversion Using Lookup Tables

Instead of diving deep into complex date algorithms, there’s a low-code method available for use. Building a lookup table and importing static data into Power Apps can make the task easier. I’ve explored this technique in previous write-ups, and here’s a demonstration of its efficacy.

I generated a sequence table using SQL Server, filled it up, and exported the results to Excel. The SQL commands to achieve this are as follows:

UPDATE NumSequenceDate
SET gdate= DATEADD(day, id, '1970-01-01')

UPDATE NumSequenceDate
SET hdate= FORMAT (gdate, 'yyyy/MM/dd', 'ar-SA')

Once we have this Excel file, it becomes straightforward in Power Apps. You can import the table and then use the lookup function to fetch the Hijri value. A formula that achieves this looks similar to:

LookUp(Hijri, GDate=Date(2009, 3, 14)).HDate

While this method offers a straightforward way to achieve conversion, there are a few points to remember. One can only import up to 15,000 Excel records. In this context, it covers about 40 years. Although adding 15,000 records might seem like a lot, it only increases the app size by approximately 100k, making the overhead negligible.

Conclusion

Answering the question, “What is the Islamic date today?” becomes significantly more manageable with the right tools and techniques. Importing a static table of dates and using the lookup function in Power Apps is a straightforward method to convert Gregorian dates to Hijri. If you ever find yourself in a situation where you need more technical assistance or have questions about other areas, don’t hesitate to contact us. Our team is always eager to assist and guide you to the best solutions.

Enhanced Support Widget