You can do this way...
Dim dateString As String = "01/02/1980"
Dim dtfi As New System.Globalization.DateTimeFormatInfo
dtfi.ShortDatePattern = "dd/MM/yyyy"
Dim d As Date = Date.Parse(dateString, dtfi)
you can create an object of type CultureInfo and use it instead of
DateTimeFormatInfo
Bruno
"Dave" <.> wrote in message news:e$**************@TK2MSFTNGP03.phx.gbl...
Hi,
I have a textbox that the user inserts the date of birth in the format
dd/mm/yyyy, I'm validating it with regex
to set the value to a Date variable, I have
dBithDay = CDate(txtBDate.txt)
but if the user enters 01/02/1980, the month of the date variable is 01
instead of 02.
should I use substring??
Thanks!