azuredate

Azure Data Studio when insert a date it automatically turn it to Hijri form


I made a Database for employee and when I try to insert date in Gregorian calendar it's automatically turn it to hijri, anyone have any idea how to fix it to only insert and appears as Gregorian?

look at the picture below to understand I have to query as a Gregorian calendar but in the table it's appear in Hijri form

This what appear in the attendance table

when i try to query in Hijri nothings appear!

I just want all the date in my database turns into Gregorian, any idea? am using Azure Data Studio on mac


Solution

  • If your database is set to use the Hijri calendar by default, then it automatically converts Gregorian dates into Hijri. If the SQL Server instance defaults to a Hijri calendar, you may need to adjust the regional settings at the SQL Server level, which can affect date interpretation and formatting. This generally requires administrative access. Otherwise, to read your Hijri dates column in Gregorian format you can use below query:

    SELECT  FORMAT(<columnName>, 'dd/MM/yyyy', 'en-US') as Attendate FROM <tableName>;
    

    Then you will get dates in Gregorian format as shown below:

    enter image description here