function validSamlDateFormat($samlDate) 
   {
      if ($samlDate == "") return false;
      $indexT = strpos($samlDate, 'T');
      $indexZ = strpos($samlDate, 'Z');
      if (($indexT != 10) || ($indexZ != 19)) {
         return false;
      }
      $dateString = substr($samlDate, 0, 10);
      $timeString = substr($samlDate, $indexT + 1, 8);
      list($year, $month, $day) = explode('-', $dateString);
      list($hour, $minute, $second) = explode(':', $timeString);
      $parsedDate = gmmktime($hour, $minute, $second, $month, $day, $year);
      if (($parsedDate === false) || ($parsedDate == -1)) return false;
      if (!checkdate($month, $day, $year)) return false;
      return $parsedDate;
   }
function validSamlDateFormat($samlDate) 
   {
      if ($samlDate == "") return false;
      $indexT = strpos($samlDate, 'T');
      $indexZ = strpos($samlDate, 'Z');
      if (($indexT != 10) || ($indexZ != 19)) {
         return false;
      }
      $dateString = substr($samlDate, 0, 10);
      $timeString = substr($samlDate, $indexT + 1, 8);
      list($year, $month, $day) = explode('-', $dateString);
      list($hour, $minute, $second) = explode(':', $timeString);
      $parsedDate = gmmktime($hour, $minute, $second, $month, $day, $year);
      if (($parsedDate === false) || ($parsedDate == -1)) return false;
      if (!checkdate($month, $day, $year)) return false;
      return $parsedDate;
   }
function validSamlDateFormat ( $ samlDate ) { if ( $ samlDate == "" ) return false ; $ indexT = strpos ( $ samlDate , 'T' ) ; $ indexZ = strpos ( $ samlDate , 'Z' ) ; if ( ( $ indexT != 10 ) || ( $ indexZ != 19 ) ) { return false ; } $ dateString = substr ( $ samlDate , 0 , 10 ) ; $ timeString = substr ( $ samlDate , $ indexT + 1 , 8 ) ; list ( $ year , $ month , $ day ) = explode ( '-' , $ dateString ) ; list ( $ hour , $ minute , $ second ) = explode ( ':' , $ timeString ) ; $ parsedDate = gmmktime ( $ hour , $ minute , $ second , $ month , $ day , $ year ) ; if ( ( $ parsedDate === false ) || ( $ parsedDate == - 1 ) ) return false ; if ( ! checkdate ( $ month , $ day , $ year ) ) return false ; return $ parsedDate ; }
Attempts to check whether a SAML date is valid.  Returns true or false.
@param string $samlDate
@return bool
Attempts to check whether a SAML date is valid . Returns true or false .