string into a date object....

Is there an easy way to get a string in the format YYYY-MM-DD into a date object?

Thanks,
Weller0123Asked:
Who is Participating?
 
Arthur_WoodConnect With a Mentor Commented:
in VB.NET, you can use the Date.Parse method to dop EXACTLY that:

 Dim strDate As String = "2005-05-23"
 Dim dtDate aDate
 dtDate  = Date.Parse(strDate)
TextBox1.Text = dtDate.ToShortDate

TextBox1 with  then hold "5/23/2005", and the variable dtDate  would hold the appropriate date value.

AW
0
 
Weller0123Author Commented:
The parse method works perfectly.

Thanks,
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.