Parse a string represengting UTC
Imports System.Globalization
Class MainClass
Public Shared Sub Main()
Dim enUS As New CultureInfo("en-US")
Dim dateString As String
Dim dateValue As Date
dateString = "2010-06-11T16:11:20.0904778Z"
Try
dateValue = Date.ParseExact(dateString, "o", CultureInfo.InvariantCulture, _
DateTimeStyles.None)
Console.WriteLine(dateValue)
Catch e As FormatException
Console.WriteLine("'{0}' is not in an acceptable format.", dateString)
End Try
End Sub
End Class
Related examples in the same category