Cdateformatter Formatyear() Method Not Found

Hi Community

When I try to use CDataFormatter to return the year of a DateTime, I am confronted with this error message:

It exists in the API:

If I use crude php methods like date(), it works perfectly but I don’t want to repeat myself.

Best regards