Got the answer:
toFormat
is deprecated in joomla 3
use Format

Example :

$cur_year    = $date->Format('%Y');