you use a DateTimeFormatInfo object, something like:
string str1 = "10/10/2007" + " " + "12.10.00";
DateTimeFormatInfo dtfi = new DateTimeFormatInfo();
dtfi.TimeSeparator = ".";
DateTime dt1 = DateTime.Parse(str1, dtfi);
HTH
Ollie Riches
"sippyuconn" <sippyuconn@newsgroup.nospamwrote in message
news:835251C8-1FFB-4B9B-90A1-0B25A65D9DA6@microsoft.com...
Quote:
Hi
>
I am having a problem formatting a string when the time is in format
hh.mm.ss - used in Europe
>
Parse seems ok when the date uses "/" or "." as seperator
but I get an exception when time uses "." as seperator as used in Europe
>
I have US regional setting and I have tried switching my regional setting
to
Europe
with no luck
>
Any ideas on what I an doing wrong???
>
Thanks
>
DateTime dt = DateTime.Parse("10/10/2007" + " " + "12:10:00"); --OK
DateTime dt = DateTime.Parse("10.10.2007" + " " + "12:10:00"); --OK
>
>
DateTime dt = DateTime.Parse("10.10.2007" + " " + "12.10.00"); -->Problem
DateTime dt = DateTime.Parse("10/10/2007" + " " + "12.10.00"); -->Problem
>
Exception
String was not recognized as a valid DateTime.