In a formula-type column, the DAY_IN_WEEK() function displays the day number of the week corresponding to a date-type column.
-
Date function name:
DAY_IN_WEEK()
Syntax
DAY_IN_WEEK(date_column)
Calling function parameters in TimeTonic:
- $field_name = field (link, linked table column, number, selection, formula, text...).
- "free text" = free text to add within quotes.
- do not use quotes for numbers.
Parameters
| Parameter | Description |
|---|---|
date_column |
The date-type column for which you want to know the day of the week. |
Example
DAY_IN_WEEK($Date)
Result: 3 for a Wednesday, 0 for a Sunday.
Notes
- Numbering starts at 0: Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6.
Return type
The function returns a number (the day number in the week).
The output type format of the result can be configured in the output field options of the formula editor. For more details, see Output format options in the Formula Column article.
Business use case
DAY_IN_WEEK() allows identifying weekends, scheduling tasks according to the day, or triggering different business rules depending on whether it is a weekday or the weekend.
Best practice
Combine DAY_IN_WEEK() with TERNARY CONDITION() to display a readable label (for example, “weekend” if the result is 0 or 6, “weekday” otherwise) instead of the raw number.