Docs For Class PHPExcel_Calculation_DateTime

PHPExcel_Calculation

# Class: PHPExcel_Calculation_DateTime

Source Location: /PHPExcel/Calculation/DateTime.php

### Class Overview

PHPExcel_Calculation_DateTime

#### Author(s):

#### Copyright:

- Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)

### Methods

- DATE
- DATEDIF
- DATENOW
- DATETIMENOW
- DATEVALUE
- DAYOFMONTH
- DAYOFWEEK
- DAYS360
- EDATE
- EOMONTH
- HOUROFDAY
- MINUTEOFHOUR
- MONTHOFYEAR
- NETWORKDAYS
- SECONDOFMINUTE
- TIME
- TIMEVALUE
- WEEKOFYEAR
- WORKDAY
- YEAR
- YEARFRAC
- _getDateValue
- _isLeapYear

### Class Details

[line 46]
PHPExcel_Calculation_DateTime

#### Tags:

copyright: | Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)

[ Top ]

### Class Methods

### static method DATE [line 206]

`static mixed DATE( [long $year = 0], [long $month = 1], [long $day = 1])`

DATE

#### Tags:

return: | Excel date/time serial value, PHP date/time serial value or PHP date/time object, depending on the value of the ReturnDateType flag
access: | public

#### Parameters:

long | $year |
long | $month |
long | $day |

[ Top ]

### static method DATEDIF [line 468]

`static long DATEDIF( [long $startDate = 0], [long $endDate = 0], [string $unit = 'D'])`

DATEDIF

#### Tags:

return: | Interval between the dates
access: | public

#### Parameters:

long | $startDate | Excel date serial value or a standard date string
long | $endDate | Excel date serial value or a standard date string
string | $unit |

[ Top ]

### static method DATENOW [line 175]

`static mixed DATENOW( )`

DATENOW

#### Tags:

return: | Excel date/time serial value, PHP date/time serial value or PHP date/time object, depending on the value of the ReturnDateType flag
access: | public

[ Top ]

### static method DATETIMENOW [line 148]

`static mixed DATETIMENOW( )`

DATETIMENOW

#### Tags:

return: | Excel date/time serial value, PHP date/time serial value or PHP date/time object, depending on the value of the ReturnDateType flag
access: | public

[ Top ]

### static method DATEVALUE [line 344]

`static mixed DATEVALUE( [string $dateValue = 1])`

DATEVALUE

#### Tags:

return: | Excel date/time serial value, PHP date/time serial value or PHP date/time object, depending on the value of the ReturnDateType flag
access: | public

#### Parameters:

string | $dateValue |

[ Top ]

### static method DAYOFMONTH [line 854]

`static int DAYOFMONTH( [long $dateValue = 1])`

DAYOFMONTH

#### Tags:

return: | Day
access: | public

#### Parameters:

long | $dateValue | Excel date serial value or a standard date string

[ Top ]

### static method DAYOFWEEK [line 878]

`static int DAYOFWEEK( [long $dateValue = 1], [ $style = 1])`

DAYOFWEEK

#### Tags:

return: | Day
access: | public

#### Parameters:

long | $dateValue | Excel date serial value or a standard date string
| $style |

[ Top ]

### static method DAYS360 [line 563]

`static long DAYS360( [long $startDate = 0], [long $endDate = 0], [boolean $method = false])`

DAYS360

#### Tags:

return: | PHP date/time serial
access: | public

#### Parameters:

long | $startDate | Excel date serial value or a standard date string
long | $endDate | Excel date serial value or a standard date string
boolean | $method | US or European Method

[ Top ]

### static method EDATE [line 1108]

`static long EDATE( [long $dateValue = 1], [int $adjustmentMonths = 0])`

EDATE

Returns the serial number that represents the date that is the indicated number of months before or after a specified date (the start_date). Use EDATE to calculate maturity dates or due dates that fall on the same day of the month as the date of issue.

#### Tags:

return: | Excel date serial value
access: | public

#### Parameters:

long | $dateValue | Excel date serial value or a standard date string
int | $adjustmentMonths | Number of months to adjust by

[ Top ]

### static method EOMONTH [line 1147]

`static long EOMONTH( [long $dateValue = 1], [int $adjustmentMonths = 0])`

EOMONTH

Returns the serial number for the last day of the month that is the indicated number of months before or after start_date. Use EOMONTH to calculate maturity dates or due dates that fall on the last day of the month.

#### Tags:

return: | Excel date serial value
access: | public

#### Parameters:

long | $dateValue | Excel date serial value or a standard date string
int | $adjustmentMonths | Number of months to adjust by

[ Top ]

### static method HOUROFDAY [line 1005]

`static int HOUROFDAY( [mixed $timeValue = 0])`

HOUROFDAY

#### Tags:

return: | Hour
access: | public

#### Parameters:

mixed | $timeValue | Excel time serial value or a standard time string

[ Top ]

### static method MINUTEOFHOUR [line 1038]

`static int MINUTEOFHOUR( [long $timeValue = 0])`

MINUTEOFHOUR

#### Tags:

return: | Minute
access: | public

#### Parameters:

long | $timeValue | Excel time serial value or a standard time string

[ Top ]

### static method MONTHOFYEAR [line 961]

`static int MONTHOFYEAR( [long $dateValue = 1])`

MONTHOFYEAR

#### Tags:

return: | Month
access: | public

#### Parameters:

long | $dateValue | Excel date serial value or a standard date string

[ Top ]

### static method NETWORKDAYS [line 691]

`static long NETWORKDAYS( mixed $startDate, mixed $endDate, array 2)`

NETWORKDAYS

#### Tags:

return: | Interval between the dates
access: | public

#### Parameters:

array | 2 | of mixed Optional Date Series
mixed | $startDate | Start date
mixed | $endDate | End date

[ Top ]

### static method SECONDOFMINUTE [line 1071]

`static int SECONDOFMINUTE( [long $timeValue = 0])`

SECONDOFMINUTE

#### Tags:

return: | Second
access: | public

#### Parameters:

long | $timeValue | Excel time serial value or a standard time string

[ Top ]

### static method TIME [line 265]

`static mixed TIME( [long $hour = 0], [long $minute = 0], [long $second = 0])`

TIME

#### Tags:

return: | Excel date/time serial value, PHP date/time serial value or PHP date/time object, depending on the value of the ReturnDateType flag
access: | public

#### Parameters:

long | $hour |
long | $minute |
long | $second |

[ Top ]

### static method TIMEVALUE [line 432]

`static mixed TIMEVALUE( string $timeValue)`

TIMEVALUE

#### Tags:

return: | Excel date/time serial value, PHP date/time serial value or PHP date/time object, depending on the value of the ReturnDateType flag
access: | public

#### Parameters:

string | $timeValue |

[ Top ]

### static method WEEKOFYEAR [line 925]

`static int WEEKOFYEAR( [long $dateValue = 1], [boolean $method = 1])`

WEEKOFYEAR

#### Tags:

return: | Week Number
access: | public

#### Parameters:

long | $dateValue | Excel date serial value or a standard date string
boolean | $method | Week begins on Sunday or Monday

[ Top ]

### static method WORKDAY [line 756]

`static long WORKDAY( mixed $startDate, mixed $endDays, array 2)`

WORKDAY

#### Tags:

return: | Interval between the dates
access: | public

#### Parameters:

array | 2 | of mixed Optional Date Series
mixed | $startDate | Start date
mixed | $endDays | number of days for adjustment

[ Top ]

### static method YEAR [line 983]

`static int YEAR( [long $dateValue = 1])`

YEAR

#### Tags:

return: | Year
access: | public

#### Parameters:

long | $dateValue | Excel date serial value or a standard date string

[ Top ]

### static method YEARFRAC [line 606]

`static float YEARFRAC( [mixed $startDate = 0], [mixed $endDate = 0], [integer $method = 0])`

YEARFRAC

Calculates the fraction of the year represented by the number of whole days between two dates (the start_date and the end_date). Use the YEARFRAC worksheet function to identify the proportion of a whole year's benefits or obligations to assign to a specific term.

#### Tags:

return: | fraction of the year
access: | public

#### Parameters:

mixed | $startDate | Excel date serial value (float), PHP date timestamp (integer) or date object, or a standard date string
mixed | $endDate | Excel date serial value (float), PHP date timestamp (integer) or date object, or a standard date string

integer

$method

Method used for the calculation

1. or omitted US (NASD) 30/360
2. Actual/actual
3. Actual/360
4. Actual/365
5. European 30/360

[ Top ]

### static method _getDateValue [line 83]

`static mixed _getDateValue( string $dateValue)`

_getDateValue

#### Tags:

return: | Excel date/time serial value, or string if error
access: | public

#### Parameters:

string | $dateValue |

[ Top ]

### static method _isLeapYear [line 48]

`static void _isLeapYear( $year)`

#### Tags:

access: | public

#### Parameters:

| $year |

[ Top ]

Documentation generated on Sun, 27 Feb 2011 16:29:27 -0800 by phpDocumentor 1.4.3