Get current week number

Hi there!

When copying a drive file, I want to rename it to have the current week number at the end.
Now in all the date-time documentation in formatting there is no clue on getting the current week number,
I was able to get the current week day using “{{$today.weekday}}” but “weeknumber” is not as simple as I thought :slight_smile:

Any help is appreciated! Will be on google myself trying to figure it out in the meantime.

Many thanks in advance!

Hi @Ian_van_Vliet,

In the Luxon documentation you can find all the date expressions you may need.

For the case you mention, it would be enough with {{$today.toFormat('WW')}} or {{DateTime.now().toFormat("WW");}} to get the number of the week of the year.

:wink:

3 Likes

Thanks, that did the trick!