Your technology certification is waiting. Enroll in Cloud Class ®
string date = "2011-09-08T16:11:56.443";
DateTime dateObj = DateTime.Parse(date);
string formattedDate = dateObj.ToString("TMM-dd-yyyyHH:mm:ss:fff");
Open in new window
//First parse your input:
if(!DateTime.TryParseExact(inputStr, "yyyy=MM=ddTHH:mm:ss.fff+0000",CultueInfo.CurrentUICulture,, DateTimeStyles.None, out dt))
throw new FormatException("Failed parsing....");
string res = dt.ToString("Tdd-MM-yyyyHH:mm:ss.fff+0000");
This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.
string request = "2011-09-08T16:11:56.443+0000";
DateTime requestDate = DateTime.Parse(request, System.Globalization.CultureInfo.CurrentUICulture, System.Globalization.DateTimeStyles.AdjustToUniversal);
DateTime utcDate = DateTime.SpecifyKind(requestDate, DateTimeKind.Utc);
string utcText = utcDate.ToString("Tdd-MM-yyyyHH:mm:ss.fff+0000");
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.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.