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

Panorama also fills in a missing century. Panorama will assume the date is in the past unless it would be within the next five years. If you want to specify a date more than five years in the future, simply be sure to fill in the entire century rather than just the last two digits of the year, for example 7/2/2044.


Error Messages

Illegal Date – This error occurs if the function does not understand the date. For example “dates” like 19/45/2912 or Monopoly 7 would produce this error.


See Also


History

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