year of current date in a microflow

1
Hi,   I need the year of the current day as a variable in a microflow: datePart(year,[%CurrentDateTime%]) But this does not work. How can I create an Integer in a MF with the year of today?   Thanks Erik
asked
3 answers
8

Might be overkill but what about:

parseInteger(formatDateTime(trimToYears([%CurrentDateTime%]),'yyyy'))
answered
3

Erik,

In Community Commons module, there is a Java action called GetIntFromDateTime that will do this for you.

Mike

answered
0

Thanks guys.

 

I tried both!!!

answered