Syntax

DATE(when)

Arguments

  • when (Date, DateTime, or Time)

Because temporal types are Text values with specific formats, any textual value may be supplied to DATE(), but non-temporal values will produce a blank result.

Return Value

Date: The converted value if when is recognized as a Date, DateTime, or Time value, or blank if not. If when is a Time value, which has no date component, a default date of 12/30/1899 is returned.

Examples

DATE("4/1/2010") : 4/1/2010

DATE(TODAY()) : Today's date from a Date value. See also TODAY().

DATE("4/1/2010 3:14") : 4/1/2010

DATE(NOW()) : Today's date from a DateTime value. See also NOW().

DATE("3:14") : 12/30/1899 (a Time value has no date component, so a default is used).

DATE(TIMENOW()) : 12/30/1899 (TIMENOW() returns a Time value, which has no date component, so a default is used).

Potential Problems

DATE("Good morning, Martin!") : Returns blank because the textual input isn't a recognized temporal type and so cannot be converted.

See Also

DATETIME(), TIME()

Did this answer your question?