date PowerHome formula function
Description
Converts a string whose value is a valid date to a datatype value of date.
Syntax
date ( string )
Argument Description
string A string containing a valid date (such as "Jan 1, 1998", or "12-31-99") that you want returned as a date
Return value
Date. Returns the date in string as a date. If string does not contain a valid date, Date returns NULL.
Usage

The value of the string must be a valid date.

Valid dates can include any combination of day (1-31), month (1-12 or the name or abbreviation of a month), and year (two or four digits). Leading zeros are optional for month and day. If the month is a name or an abbreviation, it can come before or after the day; if it is a number, it must be in the month location specified in the Windows control panel. A 4-digit number is assumed to be a year.

An expression has a more limited set of data types than the functions that can be part of the expression.

Although the Date function returns a date value, the whole expression is promoted to a DateTime value. Therefore, if your expression consists of a single Date function, it will appear that Date returns the wrong data type.

Examples
The following examples demonstrate typical syntax/usage for this function.
• date("1-23-15") --> evaluates to: 01/13/2015
• date("Jan 23 2015") --> evaluates to: 01/13/2015
• date(month(today())+"-1-"+year(today())) --> returns: the first day of the current month eg, 01/01/2015
• relativedate(date(year(today()),if(month(today())=12,1,month(today())+1),1), -1) --> returns: the last day of the current month eg, 01/31/2015