\duncan3dc\Sonos\UtilsTime

A class to represent amounts of time.

Summary

Methods
Properties
Constants
inSeconds()
parse()
start()
asInt()
asString()
__toString()
getSeconds()
getMinutes()
getHours()
format()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
__construct()
$seconds
N/A

Properties

$seconds

$seconds : integer

Type

integer — The number of seconds this instance represents.

Methods

inSeconds()

inSeconds(integer  $seconds) : \duncan3dc\Sonos\Interfaces\Utils\TimeInterface

Create a new instance from a number of seconds.

Parameters

integer $seconds

The number of seconds

Returns

\duncan3dc\Sonos\Interfaces\Utils\TimeInterface

parse()

parse(string  $string) : \duncan3dc\Sonos\Interfaces\Utils\TimeInterface

Create a new instance from a time in the format hh:mm:ss.

Parameters

string $string

The time to parse

Returns

\duncan3dc\Sonos\Interfaces\Utils\TimeInterface

asInt()

asInt() : integer

Get the number of seconds this instance represents.

Returns

integer

asString()

asString() : string

Get the time in the format hh:mm:ss.

Returns

string

__toString()

__toString() : string

Get the time in the format hh:mm:ss.

Returns

string

getSeconds()

getSeconds() : integer

Get the seconds portion of the time.

Returns

integer

getMinutes()

getMinutes() : integer

Get the minutes portion of the time.

Returns

integer

getHours()

getHours() : integer

Get the hours portion of the time.

Returns

integer

format()

format(string  $format) : string

Format the time in a custom way.

Parameters

string $format

The custom format to use. %h, %m, %s are available, and uppercase versions (%H, %M, %S) ensure a leading zero is present for single digit values

Returns

string

__construct()

__construct(integer  $seconds) 

Create a new instance from a number of seconds.

Parameters

integer $seconds

The number of seconds