Time
Table of Contents
| fromHMS() | TIME. | mixed |
|---|---|---|
| adjustSecond() | void | |
| adjustMinute() | void | |
| toIntWithNullBool() | int |
Methods
fromHMS()
TIME.
public
static fromHMS(
$hour :
mixed
, $minute :
mixed
, $second :
mixed
)
: mixed
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. PhpSpreadsheet does not change cell formatting in this way.
Excel Function: TIME(hour,minute,second)
Parameters
- $hour : mixed
A number from 0 (zero) to 32767 representing the hour. Any value greater than 23 will be divided by 24 and the remainder will be treated as the hour value. For example, TIME(27,0,0) = TIME(3,0,0) = .125 or 3:00 AM.
- $minute : mixed
A number from 0 to 32767 representing the minute. Any value greater than 59 will be converted to hours and minutes. For example, TIME(0,750,0) = TIME(12,30,0) = .520833 or 12:30 PM.
- $second : mixed
A number from 0 to 32767 representing the second. Any value greater than 59 will be converted to hours, minutes, and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148 or 12:33:20 AM
Return values
mixed —Excel date/time serial value, PHP date/time serial value or PHP date/time object, depending on the value of the ReturnDateType flag
adjustSecond()
private
static adjustSecond(
&$second :
int
, &$minute :
int
)
: void
Parameters
- $second : int
- $minute : int
adjustMinute()
private
static adjustMinute(
&$minute :
int
, &$hour :
int
)
: void
Parameters
- $minute : int
- $hour : int
toIntWithNullBool()
private
static toIntWithNullBool(
$value :
mixed
)
: int
Parameters
- $value : mixed
expect int