Provides ability to interval a fluid time stamp.

package Time
license MIT
author Aleksey Korzun
link http://alekseykorzun.com/post/7856565665/high-scalability-and-mysqls-now-dont-mix
link http://www.alekseykorzun.com

 Methods

Switch current time stamp to intervalled version

minutes(\DateInterval $interval) : string

Parameters

$interval

\DateInterval

intervals (in minutes) that you wish to break the date out to

Returns

stringprocessed time stamp

Return processed version of current time stamp

seconds(\DateInterval $interval) : string

Parameters

$interval

\DateInterval

intervals (in seconds) that you wish to break the date out to

Returns

stringprocessed time stamp

Sets new date format

setFormat(string $format) : void

see \Time\http://www.php.net/manual/en/function.date.php

Parameters

$format

string

new date format to use

Retrieves currently set date format with ability to overwrite certain parts of the date with a static number.

getFormat(string $swap) : string

Parameters

$swap

string

convert specific format characters to a static '00'

Returns

stringformat

Checks if current format supports minutes

hasMinutes() : bool

Returns

boolreturns true if support is present

Checks if current format supports seconds

hasSeconds() : bool

Returns

boolreturns true if seconds are supported

Initialize class if it was not previously initialized

initialize() : void

 Properties

 

Instance of DateTime

$date : \DateTime

 

Format used for output, defaults to Y-m-d H:i:s via initialize

$format : string