

ParseExact method will allow you to specify the exact format of your date string to use for parsing. Dim iDate As String = ""ĭim oDate As DateTime = DateTime.Parse(iDate) That means, this method can parse only strings consisting exactly of a date/time presentation, it cannot look for date/time among the text. It is very forgiving in terms of syntax and will parse dates in many different formats. MsgBox(oDate.Day & " " & oDate.Month & " " & oDate.Year)ĭateTime.Parse method supports many formats.

Dim iDate As String = ""ĭim oDate As DateTime = Convert.ToDateTime(iDate) This method will convert the specified string representation of a date and time to an equivalent date and time value. You can use the methods like Convert.ToDateTime(String), DateTime.Parse() and DateTime.ParseExact() methods for converting a string-based date to a System.DateTime object. Net, you can work with date and time easily with the DateTime class. In this Visual basic programming example, Let’s see How to Convert String to DateTime in VB.NET. How to Convert String to DateTime in VB.NET.
