How to convert date format from YYYY: mm: dd to others, for example in dd: mm: yyyy on c # in a program or on a server?

писал select convert(varchar(10), GETDATE(), 105) менял язык, т.к. пишут в разн странах разн отобр даты set language british писал SET DATEFORMAT dmy; GO после перезапустил.... На счёт стринга, да тупанул....но это не помогло, сервер ждёт формат месяц-день-год а я даю день месяц год, (а при отображении в виде год-мес-число в менедж студии)...и если я даю например 12.12.2012 то всё ок (якобы) а если 13.12.2012 то он первым воспринимает месяц...и всё((((( Менять в проге.чтоб переводила в этот дыбильный формат....а потом опять,чтоб отобразить-не хочется....Как можно на сервере это изменить? Вообщем я не знаю...просмотрел всё....не работает....может ктото знает, что не так? . . . . Есть....сделал http://hashcode.ru/questions/75572 [кому интересно прогуглите языки в базах данных] Спасибо renegator 

    1 answer 1

    Somewhere so

     string datestr = "2008:06:11"; string formatsrc = "yyyy:MM:dd"; string formatdst = "dd:MM:yyyy"; DateToime result = DateTime.ParseExact(datestr, formatsrc, CultureInfo.InvariantCulture); Console.WriteLine(result.ToString(formatdst)); 
    • does not work ... although the connection is still using System; using System.Globalization; - Rakzin Roman
    • DateToime changed on DateTime vseravno ..... - Rakzin Roman
    • one
      I do not know how and what you connected there (you did everything right), but the example is entirely working. - Specter
    • Yes .... I checked .... it works ... I take in the value of the datestr I insert radDatePicker5.SelectedValue.ToString (). Trim (); // (Drop-down list with the choice of date) ... but he, although he chooses only the date ... podtulivaet there is still time typ 01.11.2011 00:00:00, but this template does not understand this .... I took instead I took the format formatsrc wrote - "yyyy: MM: dd hh: mm: ss" and formatdst left the same / but does not work ... on the result, he writes String. - Rakzin Roman
    • But in general, you do not know whether it is possible to change the format from a year-month number to a month-month in a MSSQL server, but you’ve got something for a fucking all values ​​are entered in one format, and if the number is up to 12 (that is, it understands the month ) then the data is entered, otherwise the error .... and when I read this data, I get a vinaigrette .... - Rakzin Roman