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:

PeriodDescriptionExample
weekA temporal value representing the current week.2026-W1
monthA temporal value representing the current month2026-01
yearAn integer value representing the current year.2026

Examples

Here is an example of how to get the current week:

this week // 2026-W1
Try in Playground

You can also get the current month:

this month // 2026-01
Try in Playground

And the current year:

this year // 2026
Try in Playground