Exemplo n.º 1
0
 /**
  * Returns a numeric second given a iso-8601 datetime
  * @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS)
  * @return int second (e.g. 51)
  * @access protected
  */
 function stampToSecond($stamp)
 {
     $date = Calendar_Engine_PearDate::stampCollection($stamp);
     return (int) $date->second;
 }
 /**
  * Checks if the given day is the current day
  *
  * @param mixed $stamp Any timestamp format recognized by Pear::Date
  *
  * @return boolean
  * @access protected
  */
 function isToday($stamp)
 {
     static $today = null;
     if (is_null($today)) {
         $today = new Date();
     }
     $date = Calendar_Engine_PearDate::stampCollection($stamp);
     return $date->day == $today->getDay() && $date->month == $today->getMonth() && $date->year == $today->getYear();
 }