# GetAsDate

Returns dates in text as field type date.

`GetAsDate ( text )`

## Parameters

`text`

- any text expression or text field containing text in the same format as the date on the system where the file was created

## Data type returned

date

## Originated in

FileMaker Pro 6.0 or earlier

## Description

Use with formulas involving dates or date functions; use the GetAsDate or Date function to enter a date constant into a formula. The format of `text`

date must be the same as the numeric date format on the system where the file was created.

You can also use this function to convert the number of days to a date. If you specify a number as the parameter, it has to be between 1 (for 1/1/0001) and 1460970 (for 12/31/4000).

## Notes

•If the function returns a number instead of a date, go to the Specify Calculation dialog box and make sure the **Calculation result is** date.

## Example 1

`GetAsDate ( "03/03/2019" )`

returns **3/3/2019**. You can perform date operations on this result using the Date function.

## Example 2

`GetAsDate ( 737342 )`

returns **10/10/2019**. The number 737342 specifies the number of days since 1/1/0001.

## Example 3

Use the following formula to determine the number of days elapsed between values in two timestamp fields:

`GetAsDate ( EndDate ) - GetAsDate ( StartDate )`

returns **90** if the value in the field EndDate is `4/1/2019 1:00 AM`

and the value in the field StartDate is `1/1/2019 11:15 PM`

.

Functions reference (category list)

Functions reference (alphabetical list)

About formulas

About functions

Defining calculation fields

Using operators in formulas