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>*/
Try in Playground

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.2025-W18
monthA temporal value representing the current month2025-05
yearAn integer value representing the current year.2025

Examples

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

this week // 2025-W18
Try in Playground

You can also get the current month:

this month // 2025-05
Try in Playground

And the current year:

this year // 2025
Try in Playground