Here's an example to convert the Hijri Date to Gregorian date in SQL Server
1430/09/23 is today's Hijri date.Lets see how to convert this into Gregorian date
SELECT CONVERT(DATETIME, '23/09/1430', 131)
It would return 2009-09-12 00:00:00.000
The vice-versa,conversion from Gregorian date to Hijri date would be,
SELECT CONVERT(NCHAR, GETDATE(), 131).And this returns 23/09/1430 2:52:17:920PM
Working with Hijri Date in SQL server
Saturday, 12 September 2009
Labels:
Hijri date,
Tips
Subscribe to:
Post Comments (Atom)
5 comments:
What is Hijri Date?
Fahad, Hijri date follows the Islamic calender..You can find more about Hijri calender here : http://en.wikipedia.org/wiki/Hijri
I know hijri calender but how come it shows hirji date when we convert date in character format?
What is logic behind it...???
SQL server BOL provides the syntax to convert the Hijri date to Gregorian date and vice-versa.I hope this link would give you more insight about the internals of Hijri calendar in Windows :Hijri Calender in Windows
Dear Magesh,
I tried using this method but seems not working.
I have hijri dates in one column and want to convert it into Gregorian if it is not in hijri.
Regards.
Post a Comment