Go to Contents
Previous
Page
Next
Page
Contents > Functions reference (alphabetical list) > Date functions > Date function

Date function
Format

Date(month;day;year)
Parameters
month - the month of the year (a two-digit number; see note).
day - the day of the month (a two-digit number; see note).
year - the year (four digits between 0001 and 4000. For example, 2008 but not 08).
Important   The order of the parameters in the Date function is always Month, Day, Year, no matter what operating system or FileMaker Pro date formats you are using.
Data type returned
date
Description
Returns the calendar date for month, day, and year.
The format of the result depends on the date format that was in use when the database file was created. In the United States, dates are generally in the format MM/DD/YYYY. You can change the date format in your operating system.
You can change how the date is displayed by assigning a different date format to the field in Layout mode. Changing the formatting in this way only affects the way the data is displayed, not how it is stored.
Important   To avoid errors when using dates, always use four-digit years. For more information about how FileMaker Pro handles two-digit dates, see Conversion of dates with two-digit years.
Note   If you type a month greater than 12 or a day greater than the number of days in a month, FileMaker Pro adds the extra days or months to the result. The date function also allows zero and negative numbers as parameters.
Examples
Date(10;10;2008) returns 10/10/2008.
Date(13;1;2007) returns 1/1/2008 (one month after December 1, 2007).
Date(6;0;2008) returns 5/31/2008 (one day before June 1, 2008).
Date(6;-2;2008) returns 5/29/2008 (three days before June 1, 2008).
Related topics
Functions reference (category list)
Functions reference (alphabetical list)
About formulas
About functions
Defining calculation fields
Using operators in formulas

Contents > Functions reference (alphabetical list) > Date functions > Date function
Previous
Page
Next
Page