Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

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,
0
Weller0123
Asked:
Weller0123
1 Solution
 
Arthur_WoodCommented:
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now