How do I parse ZULU DateTime string

I need to be able to correctly parse a string to a DateTime type using the DateTime.ParseExact.
Any suggestion would be appreciated.
Thanks

CultureInfo provider = CultureInfo.InvariantCulture;
            string dateString = "091128Z July 2009";
            string format = "ddHHmmZ MMM yyyy";
            DateTime result;
 
            result = DateTime.ParseExact( dateString, format, provider );
 
The result should be   09/07/2009   11:28 AM

Open in new window

mohammad1000Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oobaylyCommented:
You've specified the format string to parse the month as an abbreviated string. Try this:
string format = "ddHHmmZ MMMM yyyy";

Open in new window

0
mohammad1000Author Commented:
Changing the format type gives incorrect time.
091128Z July 2009 converts to 7/9/2009 4:28:00 AM.

The result should be 7/9/2009  11:28 AM.
0
jinalCommented:
You have to call ToUniversalTime at last.
            DateTime dt = result.ToUniversalTime();


CultureInfo provider = CultureInfo.InvariantCulture;
            string dateString = "091128Z July 2009";
            string format = "ddHHmmZ MMMM yyyy"; 
            DateTime result;
 
            result = DateTime.ParseExact(dateString, format,provider);
            DateTime dt = result.ToUniversalTime();

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.