smalldatetime format question

  • Hi. I'm using SQL Server for some Turkish site. In Turkish culture we use DD/MM/YYYY format for date. The comp used for SQL Server is configured for Turkish language, also the collation of the database is Turkish_CI_AS. The problem is, SQL Server still uses MM/DD/YYYY format on smalldatetime fields. What should I do to make it use DD/MM/YYYY format?

    Edit:

    I'm sorry I forgot to say that I'll use the SQL Server for my ASP.NET pages. When I use DateTime.Now.ToShortDateString() the ASP.NET page displays properly, like "13.06.2003". I can't insert this value to the table. Yes, I can take Now.Day, Now.Month and Now.Year values and construct the appropriate format to insert the table but I don't want this. Is there a better way?

    Edited by - kensai on 06/10/2003 1:36:53 PM

  • Have you tried to use 'SET DATEFORMAT dmy'?

  • Select Convert(varchar(30), GetDate(), 103) will format date to dd/mm/yy and

    If you need the time value you need to use concatenation

    Select Convert(varchar(30), GetDate(), 103)+' '+

    Convert(varchar(10), GetDate(), 108)

    MW


    MW

  • In .NET is use

    Now().ToString("s").Replace("T", " ")

    which gives me yyyy-mm-dd hh:mm:ss format, which sql has no problems.

    If you do not want the time portion use

    Now().ToString("s").Substring(0,10)

    Far away is close at hand in the images of elsewhere.
    Anon.

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

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