# Age (DateTime)

| **Name**    | ***Age***                                                                                                                                                           |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax      | Age (Date start, Date end, Integer interval)                                                                                                                        |
| Purpose     | To compute the difference between two specified date time values, based on interval type (year, Month etc.) provided in integer form.                               |
| Description | Compute difference between two dates and return age in specified interval. Valid values for interval: 1=Year, 2=Month, 3=Week, 4=Day, 5=Hour, 6=Minute, or 7=Second |
| Return Type | Int64                                                                                                                                                               |
| Parameters  | <p>start \[System.DateTime]</p><p>end \[System.DateTime]</p><p>interval \[System.Int32]</p>                                                                         |

![](https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/0%20\(190\).png)

**Example**

In this example, we will pass date time values, and an integer value (indicating a specific interval) to the function transformation object using a *Variables* object.

Where,

*start* = 01-01-2022

*end* = 05-10-2024

*interval (4 = day)* = 4

<figure><img src="https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/1%20(190).png" alt=""><figcaption></figcaption></figure>

In the output window, you can see that the provided interval value, indicating days, has been used to compute the age/difference of days between the two specified date time values.

![](https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/2%20\(190\).png)
