示例#1
0
 /**
  * Returns the timestamp of the first day of the current week
  */
 function getWeekStart($y, $m, $d, $firstDay = 1)
 {
     $dow = $this->cE->getDayOfWeek($y, $m, $d);
     if ($dow > $firstDay) {
         $d -= $dow - $firstDay;
     }
     if ($dow < $firstDay) {
         $d -= $this->cE->getDaysInWeek($this->calendar->thisYear(), $this->calendar->thisMonth(), $this->calendar->thisDay()) - $firstDay + $dow;
     }
     return $this->cE->dateToStamp($y, $m, $d);
 }
 /**
  * Returns the value for the next second
  *
  * @param string $format return value format ['int'|'timestamp'|'object'|'array']
  *
  * @return int e.g. 45 or timestamp
  * @access public
  */
 function nextSecond($format = 'int')
 {
     $ts = $this->cE->dateToStamp($this->year, $this->month, $this->day, $this->hour, $this->minute, $this->second + 1);
     return $this->returnValue('Second', $format, $ts, $this->cE->stampToSecond($ts));
 }