Hi guys,
I'm working on a project that processes a lot of information, mostly dates stored as Strings (since they can be Null in the database).
So far this code worked great:
But once I use a white-space as dateseparator in the windows regional settings it crashes when using convert.toDateTime.
Any idea's how to get around this?
Thanks in advance,
Rob
I'm working on a project that processes a lot of information, mostly dates stored as Strings (since they can be Null in the database).
So far this code worked great:
VB.NET:
[COLOR=#0000ff]Dim[/COLOR] strDate [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]String[/COLOR] = Now.ToString(System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern)
Label1.Text = strDate
[COLOR=#0000ff]Dim[/COLOR] dtDate [COLOR=#0000ff]As[/COLOR] [COLOR=#0000ff]Date
[/COLOR]dtDate = Convert.ToDateTime(strDate, System.Globalization.CultureInfo.CurrentCulture)
Label2.Text = dtDate.ToString
But once I use a white-space as dateseparator in the windows regional settings it crashes when using convert.toDateTime.
Any idea's how to get around this?
Thanks in advance,
Rob