[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/phpexcel/PHPExcel/Calculation/ -> DateTime.php (summary)

(no description)

File Size: 1553 lines (69 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

PHPExcel_Calculation_DateTime:: (26 methods):
  isLeapYear()
  dateDiff360()
  getDateValue()
  getTimeValue()
  adjustDateByMonths()
  DATETIMENOW()
  DATENOW()
  DATE()
  TIME()
  DATEVALUE()
  TIMEVALUE()
  DATEDIF()
  DAYS360()
  YEARFRAC()
  NETWORKDAYS()
  WORKDAY()
  DAYOFMONTH()
  DAYOFWEEK()
  WEEKOFYEAR()
  MONTHOFYEAR()
  YEAR()
  HOUROFDAY()
  MINUTEOFHOUR()
  SECONDOFMINUTE()
  EDATE()
  EOMONTH()


Class: PHPExcel_Calculation_DateTime  - X-Ref

PHPExcel_Calculation_DateTime

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

isLeapYear($year)   X-Ref
Identify if a year is a leap year or not

param: integer    $year    The year to test
return: boolean            TRUE if the year is a leap year, otherwise FALSE

dateDiff360($startDay, $startMonth, $startYear, $endDay, $endMonth, $endYear, $methodUS)   X-Ref
Return the number of days between two dates based on a 360 day calendar

param: integer    $startDay        Day of month of the start date
param: integer    $startMonth        Month of the start date
param: integer    $startYear        Year of the start date
param: integer    $endDay            Day of month of the start date
param: integer    $endMonth        Month of the start date
param: integer    $endYear        Year of the start date
param: boolean $methodUS        Whether to use the US method or the European method of calculation
return: integer    Number of days between the start date and the end date

getDateValue($dateValue)   X-Ref
getDateValue

param: string    $dateValue
return: mixed    Excel date/time serial value, or string if error

getTimeValue($timeValue)   X-Ref
getTimeValue

param: string    $timeValue
return: mixed    Excel date/time serial value, or string if error

adjustDateByMonths($dateValue = 0, $adjustmentMonths = 0)   X-Ref
No description

DATETIMENOW()   X-Ref
DATETIMENOW

Returns the current date and time.
The NOW function is useful when you need to display the current date and time on a worksheet or
calculate a value based on the current date and time, and have that value updated each time you
open the worksheet.

NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
and time format of your regional settings. PHPExcel does not change cell formatting in this way.

Excel Function:
NOW()

return: mixed    Excel date/time serial value, PHP date/time serial value or PHP date/time object,

DATENOW()   X-Ref
DATENOW

Returns the current date.
The NOW function is useful when you need to display the current date and time on a worksheet or
calculate a value based on the current date and time, and have that value updated each time you
open the worksheet.

NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
and time format of your regional settings. PHPExcel does not change cell formatting in this way.

Excel Function:
TODAY()

return: mixed    Excel date/time serial value, PHP date/time serial value or PHP date/time object,

DATE($year = 0, $month = 1, $day = 1)   X-Ref
DATE

The DATE function returns a value that represents a particular date.

NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
format of your regional settings. PHPExcel does not change cell formatting in this way.

Excel Function:
DATE(year,month,day)

PHPExcel is a lot more forgiving than MS Excel when passing non numeric values to this function.
A Month name or abbreviation (English only at this point) such as 'January' or 'Jan' will still be accepted,
as will a day value with a suffix (e.g. '21st' rather than simply 21); again only English language.

param: integer        $year    The value of the year argument can include one to four digits.
param: integer        $month    A positive or negative integer representing the month of the year
param: integer        $day    A positive or negative integer representing the day of the month
return: mixed    Excel date/time serial value, PHP date/time serial value or PHP date/time object,

TIME($hour = 0, $minute = 0, $second = 0)   X-Ref
TIME

The TIME function returns a value that represents a particular time.

NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time
format of your regional settings. PHPExcel does not change cell formatting in this way.

Excel Function:
TIME(hour,minute,second)

param: integer        $hour        A number from 0 (zero) to 32767 representing the hour.
param: integer        $minute        A number from 0 to 32767 representing the minute.
param: integer        $second        A number from 0 to 32767 representing the second.
return: mixed    Excel date/time serial value, PHP date/time serial value or PHP date/time object,

DATEVALUE($dateValue = 1)   X-Ref
DATEVALUE

Returns a value that represents a particular date.
Use DATEVALUE to convert a date represented by a text string to an Excel or PHP date/time stamp
value.

NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
format of your regional settings. PHPExcel does not change cell formatting in this way.

Excel Function:
DATEVALUE(dateValue)

param: string    $dateValue        Text that represents a date in a Microsoft Excel date format.
return: mixed    Excel date/time serial value, PHP date/time serial value or PHP date/time object,

TIMEVALUE($timeValue)   X-Ref
TIMEVALUE

Returns a value that represents a particular time.
Use TIMEVALUE to convert a time represented by a text string to an Excel or PHP date/time stamp
value.

NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time
format of your regional settings. PHPExcel does not change cell formatting in this way.

Excel Function:
TIMEVALUE(timeValue)

param: string    $timeValue        A text string that represents a time in any one of the Microsoft
return: mixed    Excel date/time serial value, PHP date/time serial value or PHP date/time object,

DATEDIF($startDate = 0, $endDate = 0, $unit = 'D')   X-Ref
DATEDIF

param: mixed    $startDate        Excel date serial value, PHP date/time stamp, PHP DateTime object
param: mixed    $endDate        Excel date serial value, PHP date/time stamp, PHP DateTime object
param: string    $unit
return: integer    Interval between the dates

DAYS360($startDate = 0, $endDate = 0, $method = false)   X-Ref
DAYS360

Returns the number of days between two dates based on a 360-day year (twelve 30-day months),
which is used in some accounting calculations. Use this function to help compute payments if
your accounting system is based on twelve 30-day months.

Excel Function:
DAYS360(startDate,endDate[,method])

param: mixed        $startDate        Excel date serial value (float), PHP date timestamp (integer),
param: mixed        $endDate        Excel date serial value (float), PHP date timestamp (integer),
param: boolean        $method            US or European Method
return: integer        Number of days between start date and end date

YEARFRAC($startDate = 0, $endDate = 0, $method = 0)   X-Ref
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.

Excel Function:
YEARFRAC(startDate,endDate[,method])

param: mixed    $startDate        Excel date serial value (float), PHP date timestamp (integer),
param: mixed    $endDate        Excel date serial value (float), PHP date timestamp (integer),
param: integer    $method            Method used for the calculation
return: float    fraction of the year

NETWORKDAYS($startDate, $endDate)   X-Ref
NETWORKDAYS

Returns the number of whole working days between start_date and end_date. Working days
exclude weekends and any dates identified in holidays.
Use NETWORKDAYS to calculate employee benefits that accrue based on the number of days
worked during a specific term.

Excel Function:
NETWORKDAYS(startDate,endDate[,holidays[,holiday[,...]]])

param: mixed            $startDate        Excel date serial value (float), PHP date timestamp (integer),
param: mixed            $endDate        Excel date serial value (float), PHP date timestamp (integer),
param: mixed            $holidays,...    Optional series of Excel date serial value (float), PHP date
return: integer            Interval between the dates

WORKDAY($startDate, $endDays)   X-Ref
WORKDAY

Returns the date that is the indicated number of working days before or after a date (the
starting date). Working days exclude weekends and any dates identified as holidays.
Use WORKDAY to exclude weekends or holidays when you calculate invoice due dates, expected
delivery times, or the number of days of work performed.

Excel Function:
WORKDAY(startDate,endDays[,holidays[,holiday[,...]]])

param: mixed        $startDate        Excel date serial value (float), PHP date timestamp (integer),
param: integer        $endDays        The number of nonweekend and nonholiday days before or after
param: mixed        $holidays,...    Optional series of Excel date serial value (float), PHP date
return: mixed    Excel date/time serial value, PHP date/time serial value or PHP date/time object,

DAYOFMONTH($dateValue = 1)   X-Ref
DAYOFMONTH

Returns the day of the month, for a specified date. The day is given as an integer
ranging from 1 to 31.

Excel Function:
DAY(dateValue)

param: mixed    $dateValue        Excel date serial value (float), PHP date timestamp (integer),
return: int        Day of the month

DAYOFWEEK($dateValue = 1, $style = 1)   X-Ref
DAYOFWEEK

Returns the day of the week for a specified date. The day is given as an integer
ranging from 0 to 7 (dependent on the requested style).

Excel Function:
WEEKDAY(dateValue[,style])

param: mixed    $dateValue        Excel date serial value (float), PHP date timestamp (integer),
param: int        $style            A number that determines the type of return value
return: int        Day of the week value

WEEKOFYEAR($dateValue = 1, $method = 1)   X-Ref
WEEKOFYEAR

Returns the week of the year for a specified date.
The WEEKNUM function considers the week containing January 1 to be the first week of the year.
However, there is a European standard that defines the first week as the one with the majority
of days (four or more) falling in the new year. This means that for years in which there are
three days or less in the first week of January, the WEEKNUM function returns week numbers
that are incorrect according to the European standard.

Excel Function:
WEEKNUM(dateValue[,style])

param: mixed    $dateValue        Excel date serial value (float), PHP date timestamp (integer),
param: boolean    $method            Week begins on Sunday or Monday
return: int        Week Number

MONTHOFYEAR($dateValue = 1)   X-Ref
MONTHOFYEAR

Returns the month of a date represented by a serial number.
The month is given as an integer, ranging from 1 (January) to 12 (December).

Excel Function:
MONTH(dateValue)

param: mixed    $dateValue        Excel date serial value (float), PHP date timestamp (integer),
return: int        Month of the year

YEAR($dateValue = 1)   X-Ref
YEAR

Returns the year corresponding to a date.
The year is returned as an integer in the range 1900-9999.

Excel Function:
YEAR(dateValue)

param: mixed    $dateValue        Excel date serial value (float), PHP date timestamp (integer),
return: int        Year

HOUROFDAY($timeValue = 0)   X-Ref
HOUROFDAY

Returns the hour of a time value.
The hour is given as an integer, ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.).

Excel Function:
HOUR(timeValue)

param: mixed    $timeValue        Excel date serial value (float), PHP date timestamp (integer),
return: int        Hour

MINUTEOFHOUR($timeValue = 0)   X-Ref
MINUTEOFHOUR

Returns the minutes of a time value.
The minute is given as an integer, ranging from 0 to 59.

Excel Function:
MINUTE(timeValue)

param: mixed    $timeValue        Excel date serial value (float), PHP date timestamp (integer),
return: int        Minute

SECONDOFMINUTE($timeValue = 0)   X-Ref
SECONDOFMINUTE

Returns the seconds of a time value.
The second is given as an integer in the range 0 (zero) to 59.

Excel Function:
SECOND(timeValue)

param: mixed    $timeValue        Excel date serial value (float), PHP date timestamp (integer),
return: int        Second

EDATE($dateValue = 1, $adjustmentMonths = 0)   X-Ref
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.

Excel Function:
EDATE(dateValue,adjustmentMonths)

param: mixed    $dateValue            Excel date serial value (float), PHP date timestamp (integer),
param: int        $adjustmentMonths    The number of months before or after start_date.
return: mixed    Excel date/time serial value, PHP date/time serial value or PHP date/time object,

EOMONTH($dateValue = 1, $adjustmentMonths = 0)   X-Ref
EOMONTH

Returns the date value 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.

Excel Function:
EOMONTH(dateValue,adjustmentMonths)

param: mixed    $dateValue            Excel date serial value (float), PHP date timestamp (integer),
param: int        $adjustmentMonths    The number of months before or after start_date.
return: mixed    Excel date/time serial value, PHP date/time serial value or PHP date/time object,



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1