String to DateTime

S

shapper

Hello,

I have a string that contains a date in the format dd-MM-yyyy.

How can I convert it to a DateTime?

The format is always dd-MM-yyyy so I need to specify that.

Thank You,
Miguel
 
A

Arne Vajhøj

I have a string that contains a date in the format dd-MM-yyyy.

How can I convert it to a DateTime?

The format is always dd-MM-yyyy so I need to specify that.

DateTime.ParseExact or DateTime.TryParseExact should
enable you to do that.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top