End-of Date Function Calls

Last modified: August 27, 2024

Introduction

End-of date function calls calculate the end of the day, week, month, or year and return the value.

The first parameter can be an attribute of an entity of type Date and time, a variable of type Date and time, or a Date and time value created using a Date Creation function.

You can also calculate the end of a time period from the specified date. For more information, see Begin-of Date Function Calls.

endOfDay

The endOfDay function calculates the end of the day compared to the initial date.

Input Parameters

The input parameters are described in the table below:

Value Type
Initial date Date and time

Output

The output is described in the table below:

Value Type
A Date and time value that is the end of the day relative to the initial date. Date and time

Example

endOfDay(dateTime(2007, 2, 7, 1, 1))

The output is:

"Wed Feb 07 23:59 CET 2007"

endOfWeek

The endOfWeek function calculates the end of the week compared to the initial date. The beginning and the end of the week are based on the user’s locale. In the case of an anonymous user, the browser’s locale is used instead.

Input Parameters

The input parameters are described in the table below:

Value Type
Initial date Date and time

Output

The output is described in the table below:

Value Type
A Date and time value that is the end of the week relative to the initial date. Date and time

Example

endOfWeek(dateTime(2007, 2, 7, 1, 1, 1))

The output is:

"Sat Feb 10 23:59 CET 2007"

endOfMonth

The endOfMonth function calculates the end of the month compared to the initial date.

Input Parameters

The input parameters are described in the table below:

Value Type
Initial date Date and time

Output

The output is described in the table below:

Value Type
A Date and time value that is the end of the month relative to the initial date. Date and time

Example

endOfMonth(dateTime(2007, 2, 7, 1, 1, 1))

The output is:

"Wed Feb 28 23:59 CET 2007"

endOfYear

The endOfYear function calculates the end of the year compared to the initial date.

Input Parameters

The input parameters are described in the table below:

Value Type
Initial date Date and time

Output

The output is described in the table below:

Value Type
A Date and time value that is the end of the year relative to the initial date. Date and time

Example

endOfYear(dateTime(2007, 2, 7, 1, 1, 1))

The output is:

"Mon Dec 31 23:59 CET 2007"

Read More