Convert UTC (Greenwich Mean Time) from a string to DateTime type in C#

I download XML UTC string values in UTC format, like  '2011-02-28T19:43:53+00:00'
How can I convert this value to a DateTime format in C#?
esak2000Asked:
Who is Participating?
 
jdavistxCommented:
Are you after something like this?

var date = DateTime.Parse("2011-02-28T19:43:53+00:00", null, DateTimeStyles.AdjustToUniversal);

//do something with date
Console.WriteLine(date.Hours);

Open in new window

0
 
esak2000Author Commented:
Just what I wanted, thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.