Current-period macro
Learn how to get the current week, month, or year.
This macro returns the current week, month, or year. It can be used to extract a temporal value representing the current period in various formats.
To determine the current period, this macro uses the time zone and locale configured at the application level. These settings define the daylight saving time rules and which days of the week are weekdays or weekend days.
Syntax
This macro has the following syntax:
this /*<period>*/
The /*<period>*/ is a literal word that represents a specific date-time period and cannot be specified dynamically using expressions.
Here is a list of the supported period specifiers:
Period | Description | Example |
---|---|---|
week | A temporal value representing the current week. | 2025-W18 |
month | A temporal value representing the current month | 2025-05 |
year | An integer value representing the current year. | 2025 |
Examples
Here is an example of how to get the current week:
this week // 2025-W18
You can also get the current month:
this month // 2025-05
And the current year:
this year // 2025