Question : vba string to date
Answered by : vastemonde
Dim myDate As Date, strDate As String
myDate = CDate("2021-01-28")
strDate = Format(myDate, "YYYY-MM-DD") ' 2021-01-28
' String to date
myDate = CDate(Format$("20210213101235", "####-##-## ##:##:##"))
' Date to string
strDate = Format(myDate, "YYYY-MM-DD hh:mm:ss") ' 2021-02-13 10:12:35
Source : | Last Update : Fri, 12 Feb 21
Question : string to date vb
Answered by : worried-wasp-iuuql7o56gxl
Dim iDate As String = "05/05/2005"
Dim oDate As DateTime = Convert.ToDateTime(iDate)
MsgBox(oDate.Day & " " & oDate.Month & " " & oDate.Year)
Source : http://net-informations.com/q/faq/stringdate.html | Last Update : Mon, 21 Sep 20