public static function PHPExcel_Calculation_DateTime::DATETIMENOW in Loft Data Grids 6.2
Same name and namespace in other branches
- 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/DateTime.php \PHPExcel_Calculation_DateTime::DATETIMENOW()
* DATETIMENOW * * Returns the current date and time. * The NOW function is useful when you need to display the current date and time on a worksheet or * calculate a value based on the current date and time, and have that value updated each time you * open the worksheet. * * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date * and time format of your regional settings. PHPExcel does not change cell formatting in this way. * * Excel Function: * NOW() * * @access public * @category Date/Time Functions *
Return value
mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, * depending on the value of the ReturnDateType flag
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Calculation/ DateTime.php, line 180
Class
- PHPExcel_Calculation_DateTime
- PHPExcel_Calculation_DateTime
Code
public static function DATETIMENOW() {
$saveTimeZone = date_default_timezone_get();
date_default_timezone_set('UTC');
$retValue = False;
switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL:
$retValue = (double) PHPExcel_Shared_Date::PHPToExcel(time());
break;
case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC:
$retValue = (int) time();
break;
case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT:
$retValue = new DateTime();
break;
}
date_default_timezone_set($saveTimeZone);
return $retValue;
}