c# - cannot convert string to datetime using ParseExact -


I have a string like this in the XML string data file (in 12 hour clock):

  expires = "10/27/2014 2:42:57 PM"  

I used that value as a member of a class (datetime) in this way Assign to:

General. OEE XPRIZ = Datetime. Parsexact (GSAT attribute ("expires"). Value, "MM / DD / YY HH: MM: SS", Culture Info. Inverteenthalic);

But I'm getting the error 'string not recognized as a valid date time'

What am I doing wrong here?

This should be BTW in the UK, so cultureInfo should be cured

It should be :

  "MM / DD / YY H: mm: SSTT"  

As you know about tt For AM / PM, and H because you have 1-12 hours, not the format 01-12. Think if your seconds and minutes should be s and m


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -