Search code examples
asp.netvb.netdatetimeutc

UTC to datetime conversion


I have the following date time string:

2013-08-16T09:21:05-04:00

How can I get that into a local datetime format in VB.NET?

UPDATE

Just realised the string had some extra quotes on each side that hadn't been sanitized properly #blush


Solution

  • Look at the DateTime.ParseExact() and DateTime.TryParse() methods.

    http://msdn.microsoft.com/en-us/library/System.DateTime_methods.aspx