コード例 #1
0
 private function getNightCountPrivate($skipValidation = false)
 {
     if (!$skipValidation && !$this->isValid()) {
         return false;
     }
     $checkin_date = getdate(strtotime(DateUtils::getMySqlDate($this->checkInDate, $this->dateFormat)));
     $checkout_date = getdate(strtotime(DateUtils::getMySqlDate($this->checkOutDate, $this->dateFormat)));
     $checkin_date_new = mktime(12, 0, 0, $checkin_date['mon'], $checkin_date['mday'], $checkin_date['year']);
     $checkout_date_new = mktime(12, 0, 0, $checkout_date['mon'], $checkout_date['mday'], $checkout_date['year']);
     return round(abs($checkin_date_new - $checkout_date_new) / 86400);
 }
コード例 #2
0
 public function getMySqlCheckOutDate()
 {
     return DateUtils::getMySqlDate($this->checkInDate, $this->dateFormat);
 }