25 public static function day($dateValue)
27 $weirdResult = self::weirdCondition($dateValue);
28 if ($weirdResult >= 0) {
35 return $e->getMessage();
39 $PHPDateObject = SharedDateHelper::excelToDateTimeObject($dateValue);
41 return (
int) $PHPDateObject->format(
'j');
58 public static function month($dateValue)
63 return $e->getMessage();
65 if ($dateValue < 1 && SharedDateHelper::getExcelCalendar() === SharedDateHelper::CALENDAR_WINDOWS_1900) {
70 $PHPDateObject = SharedDateHelper::excelToDateTimeObject($dateValue);
72 return (
int) $PHPDateObject->format(
'n');
89 public static function year($dateValue)
94 return $e->getMessage();
97 if ($dateValue < 1 && SharedDateHelper::getExcelCalendar() === SharedDateHelper::CALENDAR_WINDOWS_1900) {
101 $PHPDateObject = SharedDateHelper::excelToDateTimeObject($dateValue);
103 return (
int) $PHPDateObject->format(
'Y');
114 if (is_bool($dateValue)) {
115 return (
int) $dateValue;
117 if ($dateValue === null) {
120 if (is_numeric($dateValue) && $dateValue < 1 && $dateValue >= 0) {
static weirdCondition($dateValue)
static year($dateValue)
YEAR.
const COMPATIBILITY_EXCEL
constants
static month($dateValue)
MONTHOFYEAR.
static getDateValue($dateValue, bool $allowBool=true)
getDateValue.
static day($dateValue)
DAYOFMONTH.
static getCompatibilityMode()
Return the current Compatibility Mode.