E
eric.goforth
Hello,
I'm trying to convert a string to a date time in a C# web service.
I'm passing in a string parameter and I have a localization setting in
my Web.config file:
My app is blowing up on the first line here, with a"Value does not fall
within the expected range" error.
CultureInfo ci = new CultureInfo("en-US",true);
ci.DateTimeFormat.ShortDatePattern =
ConfigurationSettings.AppSettings["DateFormat"];
try
{
DateTime myStartDate = DateTime.Parse(startDate, ci);
}
Any idea what's wrong? Is there a simpler way to do this?
-Eric
I'm trying to convert a string to a date time in a C# web service.
I'm passing in a string parameter and I have a localization setting in
my Web.config file:
My app is blowing up on the first line here, with a"Value does not fall
within the expected range" error.
CultureInfo ci = new CultureInfo("en-US",true);
ci.DateTimeFormat.ShortDatePattern =
ConfigurationSettings.AppSettings["DateFormat"];
try
{
DateTime myStartDate = DateTime.Parse(startDate, ci);
}
Any idea what's wrong? Is there a simpler way to do this?
-Eric