> For the complete documentation index, see [llms.txt](https://docs.videc.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.videc.de/acron-9.3/en/intro/funktionen/funk_datum.md).

# Functions Date

The Date functions group contains functions that you use to interpret and edit date/time values as a date. Almost all functions expect one or more date/time values as arguments, or return a date/time value as the result. In the group you will find the following functions:

The first column of the table contains the name of the function as you enter it in an expression. The second column contains the data types of the argument(s), and the third column contains the data type of the function's return value.

| Function                         | arguments                      | Return value |
| -------------------------------- | ------------------------------ | ------------ |
| [AddDays](#func_adddays)         | (DATETIME, NUMBER)             | DATETIME     |
| [AddMonths](#func_addmonths)     | (DATETIME, NUMBER)             | DATETIME     |
| [AddWeeks](#func_addweeks)       | (DATETIME, NUMBER)             | DATETIME     |
| [AddYears](#func_addyears)       | (DATETIME, NUMBER)             | DATETIME     |
| [DateInRange](#func_dateinrange) | (DATETIME, DATETIME, DATETIME) | DATETIME     |
| [DateToNum](#func_datetonum)     | (DATETIME)                     | NUMBER       |
| [DateYMD](#func_dateymd)         | (NUMBER, NUMBER, NUMBER)       | DATETIME     |
| [Day](#func_day)                 | (DATETIME)                     | NUMBER       |
| [DoW](#func_dow)                 | (DATETIME)                     | NUMBER       |
| [Month](#func_month)             | (DATETIME)                     | NUMBER       |
| [NumToDate](#func_numtodate)     | (NUMBER)                       | DATETIME     |
| [Today](#func_today)             | ()                             | DATETIME     |
| [WeekDay](#func_weekday)         | (DATETIME)                     | NUMBER       |
| [WeekNo](#func_weekno)           | (DATETIME)                     | NUMBER       |
| [Year](#func_year)               | (DATETIME)                     | NUMBER       |

It may be that not all the functions in this group are available in the application you are using. The application can deactivate individual functions or entire function groups in the Formula Editor. Those are normally functions which are not needed in the application, because a specific data type is not used for example.

## AddDays function <a href="#func_adddays" id="func_adddays"></a>

|               |                                                                                                                                                                                   |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | DATETIME AddDays (DATETIME, offset)                                                                                                                                               |
| Parameters:   | <ul><li>Date to be shifted.</li><li>The offset (positive or negative) by which the specified date of the first argument is to be shifted.</li></ul>                               |
| Return value: | The new date/time value after the first argument has been shifted by the specified number of days.                                                                                |
| Description:  | The function adds the number of days specified in the second parameter to the transferred date/time value. The function automatically takes into account the month and year ends. |
| Example:      | <p>Day (AddDays (Today (), -4)) = 6</p><p>Month (AddDays (Today (), -11)) = 2</p><p>if Today () was March 10, 2019 for example</p>                                                |

## AddMonths function <a href="#func_addmonths" id="func_addmonths"></a>

|               |                                                                                                                                                                                    |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | DATETIME AddMonths (DATETIME, offset)                                                                                                                                              |
| Parameters:   | <ul><li>Value of which the month is to be changed.</li><li>The offset (positive or negative) by which the number of months of the first argument is to be shifted.</li></ul>       |
| Return value: | The new date/time value after the first argument has been shifted by the specified number of months.                                                                               |
| Description:  | The function adds the number of months specified in the second parameter to the passed date/time value. The function automatically takes into account of the year ends.            |
| Example:      | <p>Day (AddMonths (Today (), -4)) = 2</p><p>Month (AddMonths (Today (), -4)) = 11</p><p>Year (AddMonths (Today (), -4)) = 2018</p><p>if Today () was March 2, 2019 for example</p> |

## AddWeeks function <a href="#func_addweeks" id="func_addweeks"></a>

|               |                                                                                                                                                                                |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Syntax:       | DATETIME AddWeeks (DATETIME, offset)                                                                                                                                           |
| Parameters:   | <ul><li>Value for which the week is to be changed.</li><li>The offset (positive or negative) by which the number of weeks of the first argument is to be shifted.</li></ul>    |
| Return value: | The new date/time value after the first argument has been shifted by the specified number of weeks                                                                             |
| Description:  | The function adds the number of weeks specified in the second parameter to the passed date/time value. The function automatically takes into account the month and year ends.  |
| Example:      | <p>Day (AddWeeks (Today (), -4)) = 2</p><p>Month (AddWeeks (Today (), -4)) = 2</p><p>Year (AddWeeks (Today (), -4)) = 2019</p><p>if Today () was March 2, 2019 for example</p> |

## AddYears function <a href="#func_addyears" id="func_addyears"></a>

|               |                                                                                                                                                                                |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Syntax:       | DATETIME AddYears (DATETIME, offset)                                                                                                                                           |
| Parameters:   | <ul><li>Value for which the year is to be changed.</li><li>The offset (positive or negative) by which the number of years of the first argument is to be shifted.</li></ul>    |
| Return value: | The new date/time value after the first argument has been shifted by the specified number of years.                                                                            |
| Description:  | The function adds the number of years specified in the second parameter to the transferred date/time value. The function automatically takes into account the leap years.      |
| Example:      | <p>Day (AddYears (Today (), -4)) = 2</p><p>Month (AddYears (Today (), -4)) = 3</p><p>Year (AddYears (Today (), -4)) = 2015</p><p>if Today () was March 2, 2019 for example</p> |

## DateInRange function <a href="#func_dateinrange" id="func_dateinrange"></a>

|               |                                                                                                                                                                                                                                                |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | BOOL DateInRange (DATETIME, minimum, maximum)                                                                                                                                                                                                  |
| Parameters:   | <ul><li>Date to be checked.</li><li>Lower limit of the interval to be checked.</li><li>Upper limit of the interval to be checked.</li></ul>                                                                                                    |
| Return value: | Returns TRUE if the first argument is within the interval. If the date is outside the limits, the function returns FALSE.                                                                                                                      |
| Description:  | Checks whether the date is within the interval limits of the range from the second and third arguments. The interval is complete, meaning a value that lies on one of the two limits is still within the limits and the function returns TRUE. |
| See also:     | [NumInRange function](/acron-9.3/en/intro/funktionen/funk_mathe.md#func_numinrange), [TimeInRange function](/acron-9.3/en/intro/funktionen/funk_zeit.md#func_timeinrange)                                                                      |

## DateToNum function <a href="#func_datetonum" id="func_datetonum"></a>

|               |                                                                                                                                                                                                                                                                                                                                                             |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | NUMBER DateToNum (DATETIME)                                                                                                                                                                                                                                                                                                                                 |
| Parameters:   | <ul><li>Date/time value to be converted to a number.</li></ul>                                                                                                                                                                                                                                                                                              |
| Return value: | A normal number corresponding to the passed date/time value.                                                                                                                                                                                                                                                                                                |
| Description:  | <p>The function converts a date/time value into a normal number.</p><p>To be able to use time values (date and/or time) in the mathematical functions or compare them with constant values, you must convert the time value into a number.</p><p>You convert a number into a date/time value with the <a href="#func_numtodate">NumToDate</a> function.</p> |
| Example:      | DateToNum (Today ()) == 90000000                                                                                                                                                                                                                                                                                                                            |

## DateYMD function <a href="#func_dateymd" id="func_dateymd"></a>

|               |                                                                                                                                                                                                                                                                            |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | DATETIME DateYMD (year, month, day)                                                                                                                                                                                                                                        |
| Parameters:   | <ul><li>Year since 1970</li><li>Month in the range 1 to 12</li><li>Day in the range 1 to 31.</li></ul>                                                                                                                                                                     |
| Return value: | The date/time value corresponding to the specified date at 00:00 hours.                                                                                                                                                                                                    |
| Description:  | The function converts the date specified in the arguments to a date/time value. If an invalid value is transferred for the argument (e.g. February 30), the function adjusts the month and day accordingly. So February 30 becomes March 1 or 2 (depending on leap years). |
| Example:      | if (DateYMD (2019,3,20) == Today (), TRUE, FALSE)                                                                                                                                                                                                                          |
| See also:     | [TimeHMS function](/acron-9.3/en/intro/funktionen/funk_zeit.md#func_timehms)                                                                                                                                                                                               |

## Day function <a href="#func_day" id="func_day"></a>

|               |                                                                                         |
| ------------- | --------------------------------------------------------------------------------------- |
| Syntax:       | NUMBER Day (DATETIME)                                                                   |
| Parameters:   | <ul><li>Specifies the date for which the day is to be found.</li></ul>                  |
| Return value: | The day of the month (1 to 31) of the specified date.                                   |
| Description:  | The function finds the day of the specified date within the month as a date/time value. |
| Example:      | <p>Day (Today ()) == 31</p><p>If today was March 31, 2019 for example.</p>              |

## DoW function <a href="#func_dow" id="func_dow"></a>

|               |                                                                                                                                                 |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | NUMBER Dow (DATETIME)                                                                                                                           |
| Parameters:   | <ul><li>Date as time value.</li></ul>                                                                                                           |
| Return value: | Day of the week.                                                                                                                                |
| Description:  | Finds the day of the week for the date passed as the argument and returns it as a number in the range from 0 to 6. The 0 corresponds to Sunday. |
| Example:      | Dow (DateYMD (2019, 31, 3)) = 0                                                                                                                 |
| See also:     | [WeekDay function](#func_weekday)                                                                                                               |

## Month function <a href="#func_month" id="func_month"></a>

|               |                                                                                |
| ------------- | ------------------------------------------------------------------------------ |
| Syntax:       | NUMBER Mont (DATETIME)                                                         |
| Parameters:   | <ul><li>Specifies the date on which the month is to be calculated.</li></ul>   |
| Return value: | The month (1 to 12) for the specified date.                                    |
| Description:  | The function calculates the month for the specified date as a date/time value. |
| Example:      | <p>Month (Today ()) = 3</p><p>If today was March 31, 2019 for example.</p>     |

## NumToDate function <a href="#func_numtodate" id="func_numtodate"></a>

|               |                                                                                                                                                                                                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Syntax:       | DATETIME NumToDate (NUMBER)                                                                                                                                                                                                                                                                      |
| Parameters:   | <ul><li>Number to be converted to a date/time value.</li></ul>                                                                                                                                                                                                                                   |
| Return value: | The date/time value equivalent to the specified number.                                                                                                                                                                                                                                          |
| Description:  | <p>The function converts a normal number into a date/time value.</p><p>To use normal numbers with the functions for date and/or time you need to convert them into a date/time value. You convert a date/time value into a number with the <a href="#func_datetonum">DateToNum</a> function.</p> |

## Today function <a href="#func_today" id="func_today"></a>

|               |                                                                            |
| ------------- | -------------------------------------------------------------------------- |
| Syntax:       | DATETIME Today ()                                                          |
| Parameters:   | <ul><li>None.</li></ul>                                                    |
| Return value: | The date/time value of the current date.                                   |
| Description:  | The function returns the date/time value of the current day, 00:00 hours.  |
| Example:      | <p>Day (Today ()) == 31</p><p>If today was March 31, 2019 for example.</p> |

## WeekDay function <a href="#func_weekday" id="func_weekday"></a>

|               |                                                                                                                                                 |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax:       | NUMBER WeekDay (DATETIME)                                                                                                                       |
| Parameters:   | <ul><li>Date as time value.</li></ul>                                                                                                           |
| Return value: | Day of the week.                                                                                                                                |
| Description:  | Finds the day of the week for the date passed as the argument and returns it as a number in the range from 0 to 6. The 0 corresponds to Sunday. |
| Example:      | WeekDay (DateYMD (2019, 31, 3)) == 3                                                                                                            |
| See also:     | [DoW function](#func_dow)                                                                                                                       |

## WeekNo function <a href="#func_weekno" id="func_weekno"></a>

|               |                                                                      |
| ------------- | -------------------------------------------------------------------- |
| Syntax:       | NUMBER WeekNo (DATETIME)                                             |
| Parameters:   | <ul><li>Date/time value with the date for the calculation.</li></ul> |
| Return value: | The ISO week number for the specified date (1-53).                   |
| Description:  | Determines the ISO week number for a date.                           |
| Example:      | WeekNo (DateYMD (2019, 3, 31)) == 13                                 |

## Year function <a href="#func_year" id="func_year"></a>

|               |                                                                                   |
| ------------- | --------------------------------------------------------------------------------- |
| Syntax:       | NUMBER Year (DATETIME)                                                            |
| Parameters:   | <ul><li>Specifies the date for which the year is to be determined.</li></ul>      |
| Return value: | The year for the specified date.                                                  |
| Description:  | The function finds the year belonging to the specified date as a date/time value. |
| Example:      | <p>Year (Today ()) == 2019</p><p>If today was March 31, 2019 for example.</p>     |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.videc.de/acron-9.3/en/intro/funktionen/funk_datum.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
