Why can’t DateTime.ParseExact() parse the AM/PM in “4/4/2010 4:20:00 PM” using “M'/'d'/'yyyy H':'mm'

Posted by Jimmy on Stack Overflow See other posts from Stack Overflow or by Jimmy
Published on 2010-04-08T01:21:07Z Indexed on 2010/04/08 1:23 UTC
Read the original article Hit count: 200

Filed under:
|
|
|

I'm using c#, and if I do

DateTime.ParseExact(“4/4/2010 4:20:00 PM”, “M'/'d'/'yyyy H':'mm':'ss' 'tt”, null)

The return value is always 4:20 AM -- what am I doing wrong with using tt?

Thanks!

© Stack Overflow or respective owner

Related posts about datetime

Related posts about parse