DateFormat Function in VS 2008


The DateFormat.ShortDate gives me date like 2/7/2014. Is there anyway to get 02/07/2014?

Who is Participating?
käµfm³d 👽Connect With a Mentor Commented:
Use an explicit format specifier:

Dim d As DateTime = DateTime.Now
Dim s As String = d.ToString("MM/dd/yyyy")   ' Case important!

Open in new window

A good resource for format specifiers is here:
mrongAuthor Commented:
Can I use it in VS expression? thx
mrongAuthor Commented:
Should be the following in expression

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.