Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Need to extract the current year only from a form calc date variable

Avatar

Level 1

Hi,

I need to extract the year only from a date variable.How can I use the num2date(date()) to do this?

eg. num2date(date(), "YYYY MM DD") retunrs me the whole date, but I need only the current year.

Thanks in advance.

Abel.

1 Reply

Avatar

Level 10

Hi,

use $ = Num2Date(date(), "YYYY")

and the display pattern date{YYYY}