Constants

CALENDAR_WINDOWS_1900

CALENDAR_WINDOWS_1900 = 1900

constants

CALENDAR_MAC_1904

CALENDAR_MAC_1904 = 1904

Properties

$_monthNames

$_monthNames

$_numberSuffixes

$_numberSuffixes

$_excelBaseDate

$_excelBaseDate

$possibleDateFormatCharacters

$possibleDateFormatCharacters

Methods

setExcelCalendar()

setExcelCalendar(int  $baseDate) : bool

Set the Excel calendar (Windows 1900 or Mac 1904)

Parameters

int $baseDate

Excel base date (1900 or 1904)

Returns

bool —

Success or failure

getExcelCalendar()

getExcelCalendar() : int

Return the Excel calendar (Windows 1900 or Mac 1904)

Returns

int —

Excel base date (1900 or 1904)

ExcelToPHP()

ExcelToPHP(\long  $dateValue, bool  $adjustToTimezone = FALSE, string  $timezone = NULL) : \long

Convert a date from Excel to PHP

Parameters

\long $dateValue

Excel date/time value

bool $adjustToTimezone

Flag indicating whether $dateValue should be treated as a UST timestamp, or adjusted to UST

string $timezone

The timezone for finding the adjustment from UST

Returns

\long —

PHP serialized date/time

ExcelToPHPObject()

ExcelToPHPObject(int  $dateValue) : int

Convert a date from Excel to a PHP Date/Time object

Parameters

int $dateValue

Excel date/time value

Returns

int —

PHP date/time object

PHPToExcel()

PHPToExcel(mixed  $dateValue, bool  $adjustToTimezone = FALSE, string  $timezone = NULL) : mixed

Convert a date from PHP to Excel

Parameters

mixed $dateValue

PHP serialized date/time or date object

bool $adjustToTimezone

Flag indicating whether $dateValue should be treated as a UST timestamp, or adjusted to UST

string $timezone

The timezone for finding the adjustment from UST

Returns

mixed —

Excel date/time value or boolean FALSE on failure

FormattedPHPToExcel()

FormattedPHPToExcel(\long  $year, \long  $month, \long  $day, \long  $hours, \long  $minutes, \long  $seconds) : \long

FormattedPHPToExcel

Parameters

\long $year
\long $month
\long $day
\long $hours
\long $minutes
\long $seconds

Returns

\long —

Excel date/time value

isDateTime()

isDateTime(\PHPExcel_Cell  $pCell) : bool

Is a given cell a date/time?

Parameters

\PHPExcel_Cell $pCell

Returns

bool —

isDateTimeFormat()

isDateTimeFormat(\PHPExcel_Style_NumberFormat  $pFormat) : bool

Is a given number format a date/time?

Parameters

\PHPExcel_Style_NumberFormat $pFormat

Returns

bool —

isDateTimeFormatCode()

isDateTimeFormatCode(string  $pFormatCode = '') : bool

Is a given number format code a date/time?

Parameters

string $pFormatCode

Returns

bool —

stringToExcel()

stringToExcel(string  $dateValue = '') : float|false

Convert a date/time string to Excel time

Parameters

string $dateValue

Examples: '2009-12-31', '2009-12-31 15:59', '2009-12-31 15:59:10'

Returns

float|false —

Excel date/time serial value

monthStringToNumber()

monthStringToNumber(mixed  $month) : mixed

Parameters

mixed $month

Returns

mixed —

dayStringToNumber()

dayStringToNumber(mixed  $day) : mixed

Parameters

mixed $day

Returns

mixed —