Converts String to a DateTimeOffset equivalent with format.
Imports System
Imports System.Xml
Module Module1
Sub Main()
Dim reader As XmlReader = XmlReader.Create("myData.xml")
reader.ReadToFollowing("time")
Dim time As String = reader.ReadElementContentAsString()
Dim format As String = "yyyy-MM-ddTHH:mm:sszzzzzzz"
Try
Dim transaction_time As DateTimeOffset = XmlConvert.ToDateTimeOffset(time, format)
Console.WriteLine(transaction_time)
Catch e As Exception
Console.WriteLine(e)
End Try
End Sub 'Main
End Module
Related examples in the same category