ParseExact problem

  • Thread starter Dermot O'Loughlin
  • Start date
D

Dermot O'Loughlin

Please see the following code where i am trying to parse a date time string:

DateTime dt = DateTime.ParseExact("08/02/2005", "dd/mm/yyyy", null);

When doing a watch on dt the date get sets to 1/8/2005

This happens for any date string that i try to parse - any ideas.

Thanks,
Dermot.
 
C

Cor Ligthert

Dermot,

Yes because you probably want to use the month MM and not the minutes mm
which are not in your string.

:)

Cor
 
D

Dermot O'Loughlin

Cor,

that was it - silly mistake.

Thanks for your help with this.

Dermot.
 

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