How to extract Year from DateTime php object

from PHP 5.3 there is DataTime Object You can do like this : $date = new DateTime(); $currentYear = intval($date->format("Y")); חילוץ שנה מתוך אוביקט DateTime בשפת php