How to set format to ToString("MM/dd/yyyy")?

I am trying to set format to a DATETIME var while passing it to a string.

I am getting the error: Error 4 Cannot implicitly convert type 'string' to 'System.DateTime?'
RahnAsked:
Who is Participating?
 
zadeveloperConnect With a Mentor Commented:
Really sorry man

Convert.ToDateTime("1 Jan 2000").ToString("dd/MM/yyyy")

Open in new window

0
 
zadeveloperCommented:
use:



Convert.ToDateTime("1 Jan 200")

Open in new window

0
 
zadeveloperCommented:
2000 :)

Convert.ToDateTime("1 Jan 2000")

Open in new window

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.