DateValue Function

 

DateValue(dateexpression)

 

Returns a variant (Date) corresponding to the string date expression that was passed in.  dateexpression can be a string or any expression that can represent a date, time or both a date and a time.

 

Related Topics: DateSerial. TimeSerial, TimeValue

 

Example:

 

Sub Main()

Dim v As Variant

Dim d As Double

        d = Now

        Print d        

        v = DateValue("1959/05/29")

        MsgBox (VarType(v))

        MsgBox (v)

End Sub