Get String of Today's Date in mm-dd-yy format (in VB.net)

Viewed 29

I am trying to create a string of today's date in VB.net and this is the code I am trying:

Dim strtest As String
strtest = CStr(DatePart("mm", Date.Today) & "-" & CStr(DatePart("dd", Date.Today)) _ 
& "-" & CStr(DatePart("yy", Date.Today)))

however, I am receiving the following error, "Argument 'Interval is not a valid value"

What am I doing wrong?

0 Answers
Related