The SqlDateTime.Parse() method does not seem to be honouring the current
culture.  I am in the UK and have checked that
System.Globalization.CultureInfo.CurrentCulture is set to "en-GB".  I'm sure
everyone knows that in the UK we usually format our dates as dd/MM/yyyy.
>From the immediate window:

?DateTime.Parse("1/2/2002").ToString("dd-MMM-yyyy")
"01-Feb-2002"

?SqlDateTime.Parse("1/2/2002").Value.ToString("dd-MMM-yyyy")
"02-Jan-2002"

DateTime.Parse works as expected, but SqlDateTime assumes a US format when
parsing the string.

Can anybody confirm this as a bug? or am I doing something wrong?

Mark

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to