Long Date with Respect Locale Settings

  • I am trying to get Long Date like '12 July 2002' using CONVERT function. The problem is I dont know the locale settings of the system. My question is is it possible that CONVERT return LongDate according to the machine's Locale Settings or there is a way to find Locale Settings in SQL Server?

    Kashif.

  • I believe the convert function is independent of regional settings: -

    select convert(char(16),getdate(),106)

    will give '16 Jul 2002' (i.e. not full month but char(3)).

    Regards,

    Andy Jones

    .

  • Thanx, but I want the format with respect to Locale Settings. The problem is we have different clients who uses different Long Date formats according to their Locale Settings. e.g. for date 4th July some clients require '4 July 2002' and some require 'July 4 2002'.

    Regards,

  • FOr you to output different long date formats you need to setup each user with the version valid for them in there login. This can be defined by using sp_defaultlanguage.

    This will allow you to set to local laguage settings of the user.

    See BOL for more detail.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Thanx Antares686. Now I am looking at the ways how to make useful exactly as I want.

    Regards

    Kashif.

Viewing 5 posts - 1 through 4 (of 4 total)

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