Extract year

Good day!:)

We are creating a module that displays reports from a database and part of this module is to let users view reports by year. For users to easily choose the year of the report, we would like to create a dynamic dropdown menu listing the years. We planned to do this by checking the database for the most recent year of posted reports. So we’d like to extract the year from the given searched date. Is it possible? if so, how will it be done?

Please anyone

Good morning :)

Is this what you are looking for?

Native PHP: http://php.net/manual/en/function.date.php

– or –

Yii: http://www.yiiframework.com/doc/api/1.1/CFormatter