CDate

Function that converts an expression into a date value

Syntax
      CDate (expression)

The expression must be a valid date. The Date data type accepts either the date or the time, or both. Possible values range from January 1, 100 to December 31, 9999.

CDate cannot handle Null values.

Example

Dim dtmRetirement
dtmRetirement = CDate("Aug 6, 2083")

“The hours of folly are measured by the clock, but of wisdom no clock can measure” ~ William Blake

Related:

CBool - Convert to boolean
CInt - Convert to Integer (number)
Standard date and time notation - YYYY-MM-DD
Syntax - IsBlank function to detect Empty or NULL or Zero.


© Copyright SS64.com 1999-2013
Some rights reserved