You are here

public static function PHPExcel_Calculation_DateTime::MONTHOFYEAR in Loft Data Grids 6.2

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

* MONTHOFYEAR * * Returns the month of a date represented by a serial number. * The month is given as an integer, ranging from 1 (January) to 12 (December). * * Excel Function: * MONTH(dateValue) * *

Parameters

mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),: * PHP DateTime object, or a standard date string * @return int Month of the year

1 call to PHPExcel_Calculation_DateTime::MONTHOFYEAR()
PHPExcel_Calculation_DateTime::YEARFRAC in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/DateTime.php
* YEARFRAC * * Calculates the fraction of the year represented by the number of whole days between two dates * (the start_date and the end_date). * Use the YEARFRAC worksheet function to identify the proportion of a whole year's benefits…

File

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

Class

PHPExcel_Calculation_DateTime
PHPExcel_Calculation_DateTime

Code

public static function MONTHOFYEAR($dateValue = 1) {
  $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
  if ($dateValue === null) {
    $dateValue = 1;
  }
  elseif (is_string($dateValue = self::_getDateValue($dateValue))) {
    return PHPExcel_Calculation_Functions::VALUE();
  }
  elseif ($dateValue < 0.0) {
    return PHPExcel_Calculation_Functions::NaN();
  }

  // Execute function
  $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
  return (int) $PHPDateObject
    ->format('n');
}