How can I store Hijri date inside Sql Server DateTimeOffset column?

Viewed 32

I am working on a legacy website and they are storing all Hijri dates inside nvarchar(10) column. Now they are rebuilding the system and they need to convert from nvarchar(10) into DateTimeOffset column.

When I try to use the following command to cast into DateTimeOffset:

Select Cast('1444-02-30' as DateTimeOffset)

It shows me a conversion error as there are no 30 days in February.

So, does it mean that I cannot store Hijri dates inside DateTimeOffset column or is there a workaround I can apply to make it work?

0 Answers
Related