How do I render only the Year of a date?

I have created a block with a date field and I want to be able to choose a date (DD.MM.YYY) in the panel, but on the website, only the year should be visible.
This renders the full date:

<?= $block->date(); ?>



`<?= $block->date('Y'); ?>`
// block -> field -> fieldmethod
<?= $block->date()->toDate('Y'); ?>

Thanks, that works!