You are here

public static function PHPExcel_Calculation_DateTime::SECONDOFMINUTE in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/DateTime.php \PHPExcel_Calculation_DateTime::SECONDOFMINUTE()

* SECONDOFMINUTE * * Returns the seconds of a time value. * The second is given as an integer in the range 0 (zero) to 59. * * Excel Function: * SECOND(timeValue) * *

Parameters

mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),: * PHP DateTime object, or a standard time string * @return int Second

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/DateTime.php, line 1364

Class

PHPExcel_Calculation_DateTime
PHPExcel_Calculation_DateTime

Code

public static function SECONDOFMINUTE($timeValue = 0) {
  $timeValue = PHPExcel_Calculation_Functions::flattenSingleValue($timeValue);
  if (!is_numeric($timeValue)) {
    if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
      $testVal = strtok($timeValue, '/-: ');
      if (strlen($testVal) < strlen($timeValue)) {
        return PHPExcel_Calculation_Functions::VALUE();
      }
    }
    $timeValue = self::_getTimeValue($timeValue);
    if (is_string($timeValue)) {
      return PHPExcel_Calculation_Functions::VALUE();
    }
  }

  // Execute function
  if ($timeValue >= 1) {
    $timeValue = fmod($timeValue, 1);
  }
  elseif ($timeValue < 0.0) {
    return PHPExcel_Calculation_Functions::NaN();
  }
  $timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue);
  return (int) gmdate('s', $timeValue);
}