Thai Buddhist Calendar format in SQL Server

  • ganand_online


    Points: 465

    People in Thailand use the Thai Buddha calendar format, which is 543 years ahead of the Gregorian calendar format. The year in the Thai Buddha calendar now is 2551. This, though handled in the operating system (Windows 2003), is not handled in SQL Server 2005.

    I have tried searching settings in SQL Server, but have not been able to find anything. Is there a setting where I can set the calendar/date formats at the server/database level?

    Steps to reproduce the problem:

    1. Change Windows regional settings to Thai.

    2. Add the Thai language in the Windows regional settings.

    3. Set THAI_CS_AS as the default collation during SQL Server installation.

    4. Set THAI_CS_AS as the collation for the database I'm testing this on.

    5. Set the default language to Thai (sp_configure 'default_language', 32)

    6. Run the following commands:


    set language Thai


    set dateformat 'dmy'



    SET @Today = '12/1/2008'

    SELECT DATENAME(month, @Today) AS 'Month'


    The output I get is this (and this is the expected output): มกราคม

    However, when I try running the same query to get the date:



    SET @Today = '12/1/2008'

    SELECT DATENAME(year, @Today) AS 'Year'


    I get '2003' as the output. It should be displaying 2551.

    I would like to know if there is a setting where I can set the calendar format from Gregorian to Thai Buddhist at the database/server level.

    SOS !!!

  • RyanRandall


    Points: 13623

    Duplicate post.

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply