/** * Returns the timestamp for first day of the year for the given date. * * @param timestamp * @return timestamp */ public static function firstDayOfYear($ts = null) { // default to now if ($ts === null) { $ts = sfDateTimeToolkit::now(); } return sfTime::subtractMonth(sfTime::firstDayOfMonth($ts), date('m', $ts) - 1); }