PHPExcel_Shared_Date

category | PHPExcel
package | PHPExcel_Shared
copyright | Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)

### Methods

## Convert a date from Excel to PHP

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

Static

### Parameters

#### $dateValue

`\long`

Excel date/time value

#### $adjustToTimezone

`boolean`

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

#### $timezone

`string`

The timezone for finding the adjustment from UST

### Returns

`\long`PHP serialized date/time

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

    ExcelToPHPObject(integer $dateValue) : integer

Static

### Parameters

#### $dateValue

`integer`

Excel date/time value

### Returns

`integer`PHP date/time object

## FormattedPHPToExcel

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

Static

### Parameters

#### $year

`\long`

#### $month

`\long`

#### $day

`\long`

#### $hours

`\long`

#### $minutes

`\long`

#### $seconds

`\long`

### Returns

`\long`Excel date/time value

## Convert a date from PHP to Excel

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

Static

### Parameters

#### $dateValue

`mixed`

PHP serialized date/time or date object

#### $adjustToTimezone

`boolean`

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

#### $timezone

`string`

The timezone for finding the adjustment from UST

### Returns

`mixed`Excel date/time value or boolean FALSE on failure

## dayStringToNumber()

    dayStringToNumber($day)

Static

### Parameters

#### $day

## Return the Excel calendar (Windows 1900 or Mac 1904)

    getExcelCalendar() : integer

Static

### Returns

`integer`Excel base date (1900 or 1904)

## Is a given cell a date/time?

    isDateTime(\PHPExcel_Cell $pCell) : boolean

Static

### Parameters

#### $pCell

`\PHPExcel_Cell`

### Returns

`boolean`

## Is a given number format a date/time?

    isDateTimeFormat(\PHPExcel_Style_NumberFormat $pFormat) : boolean

Static

### Parameters

#### $pFormat

`\PHPExcel_Style_NumberFormat`

### Returns

`boolean`

## Is a given number format code a date/time?

    isDateTimeFormatCode(string $pFormatCode) : boolean

Static

### Parameters

#### $pFormatCode

`string`

### Returns

`boolean`

## monthStringToNumber()

    monthStringToNumber($month)

Static

### Parameters

#### $month

## Set the Excel calendar (Windows 1900 or Mac 1904)

    setExcelCalendar(integer $baseDate) : boolean

Static

### Parameters

#### $baseDate

`integer`

Excel base date (1900 or 1904)

### Returns

`boolean`Success or failure

## Convert a date/time string to Excel time

    stringToExcel(string $dateValue) : float | FALSE

Static

### Parameters

#### $dateValue

`string`

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

### Returns

`float` `FALSE`Excel date/time serial value

### Properties

##

    $_monthNames

##

    $_numberSuffixes

##

    $_excelBaseDate

##

    $possibleDateFormatCharacters

### Constants

## CALENDAR_MAC_1904

    CALENDAR_MAC_1904

## constants

    CALENDAR_WINDOWS_1900