コード例 #1
0
ファイル: UnixTS.php プロジェクト: ddrmoscow/queXS
 /**
  * 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_date = @date('Y n j');
         $today = sscanf($today_date, '%d %d %d');
     }
     $date = Calendar_Engine_UnixTS::stampCollection($stamp);
     return $date[2] == $today[2] && $date[1] == $today[1] && $date[0] == $today[0];
 }
コード例 #2
0
 /**
  * Returns the number of the day of the week (0=sunday, 1=monday...)
  * @param int year (2003)
  * @param int month (9)
  * @param int day (4)
  * @return int weekday number
  * @access protected
  */
 function getDayOfWeek($y, $m, $d)
 {
     $stamp = Calendar_Engine_UnixTS::dateToStamp($y, $m, $d);
     $date = Calendar_Engine_UnixTS::stampCollection($stamp);
     return $date[8];
 }