date format validation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • henk

    #1

    date format validation

    Hi,

    I want to validate/"autocomple " a string from a textbox.
    The string could be eg:
    "1 2 3"
    "01-02-2003"
    "1-feb-2003"
    etc.

    I found one solution for this:
    TextBox1.Text = Format(CDate(Te xtBox2.Text), "dd-MMM-yyyy").ToString

    form load:
    Thread.CurrentT hread.CurrentCu lture = New CultureInfo("nl-NL", False)

    This results in :"01-feb-2003" wich is what I want.

    Without the cultureInfo the date would be: "02-Jan-2003".

    question is:
    -is this the only possible solution?
    -Do I need to reset the cultureinfo back to the original value, to
    prevent other effects as eg decimalseparato rs.

    Thanks in advance

Working...