Constants

CALENDAR_WINDOWS_1900

CALENDAR_WINDOWS_1900 = 1900

constants

CALENDAR_MAC_1904

CALENDAR_MAC_1904 = 1904

Properties

$_monthNames

$_monthNames : 

Type

$_numberSuffixes

$_numberSuffixes : 

Type

$_excelBaseDate

$_excelBaseDate : 

Type

$possibleDateFormatCharacters

$possibleDateFormatCharacters : 

Type

Methods

setExcelCalendar()

setExcelCalendar(integer  $baseDate) : boolean

Set the Excel calendar (Windows 1900 or Mac 1904)

Parameters

integer $baseDate

Excel base date (1900 or 1904)

Returns

boolean —

Success or failure

getExcelCalendar()

getExcelCalendar() : integer

Return the Excel calendar (Windows 1900 or Mac 1904)

Returns

integer —

Excel base date (1900 or 1904)

ExcelToPHP()

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

Convert a date from Excel to PHP

Parameters

\long $dateValue

Excel date/time value

boolean $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(integer  $dateValue) : \DateTime

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

Parameters

integer $dateValue

Excel date/time value

Returns

\DateTime —

PHP date/time object

PHPToExcel()

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

Convert a date from PHP to Excel

Parameters

mixed $dateValue

PHP serialized date/time or date object

boolean $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) : boolean

Is a given cell a date/time?

Parameters

\PHPExcel_Cell $pCell

Returns

boolean

isDateTimeFormat()

isDateTimeFormat(\PHPExcel_Style_NumberFormat  $pFormat) : boolean

Is a given number format a date/time?

Parameters

\PHPExcel_Style_NumberFormat $pFormat

Returns

boolean

isDateTimeFormatCode()

isDateTimeFormatCode(string  $pFormatCode = '') : boolean

Is a given number format code a date/time?

Parameters

string $pFormatCode

Returns

boolean

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(  $month) 

Parameters

$month

dayStringToNumber()

dayStringToNumber(  $day) 

Parameters

$day