More errors in convert function

In hijri calender any month can be 30 or 29 day
in convert function
if I write
select convert (datetime ,'29-12-1426,131) it is ok
this year 12 month is 30 days
but if I write
select convert (datetime ,'30-12-1426,131)
ther is an error

Thanks for any help




Answer this question

More errors in convert function

  • Nathan Tregillus

    Tamer229,

    There are many variations of the Islamic calendar.  In some versions,
    there are 29 days in the month Thou Alhajja in the year 1426, and in
    others there are 30 days.  There are only 29 days in this month
    according to the Islamic calendar version used by Microsoft, which
    is why you are getting an error when you try to convert the 30th day
    of this month. In the Microsoft version, the western date January
    30, 2006 is the first day of Muharram, 1427.  In other versions of
    the Islamic calendar, January 30, 2006 is the 30th day of Thou Alhajja,
    1426.

    See http://www.phys.uu.nl/~vgent/islam/islamyear_en.htm
    for a calculator that shows several versions.  The version used
    by Microsoft is labeled "Ia [15, astronomical = “Kuwaiti algorithm”]"

    Steve Kass
    Drew University

  • More errors in convert function