Returns Date
from Date
, DateTime
, or Time
. If a Time
value is specified, which has no date component, returns a default date of 12/30/1899
. If the specified value is not a Date
, DateTime
, or Time
value, returns a blank.
Sample usage
DATE("4/1/2010")
returns 4/1/2010
DATE(TODAY())
returns today's date from a Date
value. See also: TODAY()
DATE("4/1/2010 3:14")
returns 4/1/2010
DATE(NOW())
returns today's date from a DateTime
value. See also: NOW()
DATE("3:14")
returns 12/30/1899 (a Time
value has no date component, so a default is used).
DATE(TIMENOW())
returns 12/30/1899 (TIMENOW()
returns a Time
value, which has no date component, so a default is used).
Common problems
DATE("Good morning, Martin!")
returns blank because the textual input isn't a recognized temporal type and so cannot be converted.
Syntax
DATE(when)
-
when
- ADate
,DateTime
, orTime
value.
Notes
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.