toStartOfWeek()
Table of Contents
Overview
The toStartOfWeek() function takes a dateTimeValue as an argument, and returns the starting date of the week the dateTimeValue falls in.
The date-time value will be returned in the format specified in Application Settings.
Note: Sunday is considered as the first day of a week.
Return Type
- Date-Time
Syntax
<variable> = <dateTimeValue>.toStartOfWeek();
(OR)
<variable> = toStartOfWeek(<dateTimeValue>);
Parameter | Description | Data type |
---|---|---|
<variable> | Variable which will contain the returned date-time value. | DATE-TIME |
<dateTimeValue> | The starting date of the week this date-time value falls in, will be returned. The time value is not taken into account while using this function. A runtime error will be encountered if:
The function returns a null value if:
Please refer this help document to learn about the supported date-time formats. | DATE-TIME |
Examples
currentDate = '15-Mar-2019 15:00:00';
startDate= currentDate.toStartOfWeek(); // returns '10-Mar-2019 00:00:00'
startDate= currentDate.toStartOfWeek(); // returns '10-Mar-2019 00:00:00'