date(

date(TEXT

)
The** date( **function converts text into a number representing a date.

**Parameters**

This function has one parameter:

** text** – The text to be converted into a date.

**Description**

This function takes a text value and converts it into a number representing the date. The number is the number of days since January 1, 4713 B.C. For example, if the text is *August 7, 1991* this function will return the number *2,448,476*. Here are some examples of valid dates:

```
5/7/96
August 8, 1957
may 12
12 may
apr
June 4th, 2011
2011-06-04
today
yesterday
tomorrow
tuesday
last fri
next monday
```

(Note: The fifth example, *apr*, is equivalent to April 1st.)

The function allows any character to be used as a separator. All of the dates listed below are equivalent:

```
4/2/98
4-2-98
4 2 98
4.2.98
April 2 98
April.2.98
April 2nd, 98
2-apr-98
2 april 98
```

Examples:

`date("7/4/1776")☞ `*2369916
date("yesterday")☞ **2457260
*

**Error Messages**

** Illegal Date** – This error occurs if the function does not understand the date. For example “dates” like

**See Also**

- calendardate( -- helps in creating monthly calendars.
- calendarday( -- helps in creating monthly calendars.
- Date Patterns -- control how dates are displayed or converted to text.
- datepattern( -- converts a number representing a date into text. The function uses a pattern to control how the date is formatted (see Date Patterns).
- datevalue( -- converts integer values for year, month and day into a number representing a date.
- dayofweek( -- computes the day of the week, with Sunday being 0, Monday 1, etc.
- dayvalue( -- extracts the day from a date as a numeric value.
- firstdayofweek( -- returns the user's preference for first day of the week.
- groupdatepattern( -- converts a number representing a date into text in a special format for use with the summarytable( and crosstab( functions. The function uses a pattern to control how the date is formatted (see Date Patterns).
- month1st( -- computes the first day of a month.
- monthlength( -- computes the length (number of days) of a month.
- monthmath( -- takes a date and computes the date that is one or more months before or after the original date.
- monthvalue( -- extracts the month from a date as a numeric value.
- naturaldate( -- converts a number representing a date into text using "natural" formatting.
- quarter1st( -- computes the first day of a quarter.
- quartervalue( -- extracts the quarter from a date as a numeric value.
- regulardate( -- extracts a regular date (number of days from January 1, 4713 B.C.) from a superdate.
- superdate( -- converts a regular date and a regular time into a superdate.
- superdatepattern( -- converts a number containing a superdate to text, allowing you to specify the patterns for both the date and the time conversion to text.
- superdatesecondsstr( -- converts a number containing a superdate to text, including the seconds.
- superdatestr( -- converts a number containing a superdate (date + time) to text.
- supernow( -- returns the number representing the current date and time as a superdate.
- today( -- returns a number corresponding to today's date.
- week1st( -- computes the first day of a week (Sunday).
- weekvalue( -- extracts the week from a date as a numeric value.
- year1st( -- computes the first day of a year.
- yearvalue( -- extracts the year from a date as a numeric value.

**History**

Version | Status | Notes |

10.0 | No Change | Carried over from Panorama 6.0 (however, this version is a bit more tolerant on date formatting than previous versions were). |