> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# WEEKNUM

> The WEEKNUM function returns the week number of a specified date within the year. It works across multiple YiDA scenarios, including Form and workflow design. The function takes a time object as input and lets you optionally set the start of the week to Sunday or Monday, with Sunday as the default.

The **WEEKNUM** function returns the week number of a specified date within the year.

## Supported Scenarios

The WEEKNUM function is supported in the following YiDA scenarios:

* Form (main form fields)
* Form (business association rules)
* Form (validation)
* Workflow design (validation rules)
* Workflow design (association actions)
* Integration and automation
* Workflow node
* Connector

## Syntax

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
WEEKNUM(date, return_type)
```

## Attributes

| **Attribute** | **Required** | **Description**                                                                                                               |
| ------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| date          | Yes          | The time object.                                                                                                              |
| return\_type  | No           | The start day of the week. Values:<br />• 1: The week starts on Sunday.<br />• 2: The week starts on Monday.<br />Default: 1. |

## Return Value

| **Return type** | **Description**              |
| --------------- | ---------------------------- |
| Number          | The week number of the date. |

## Example

As shown in the figure below, use the `WEEKNUM()` function to get the week number of a specified date.

## Try It

Returns the week number of a specified date. For example, the week that contains January 1 is the first week of the year and is numbered as week 1.
