Spork Code Libraries

DateTime

Extends DateTime class to extend functionality

Summary

Properties

Constants

Extends
\DateTime

Methods

__construct()

__construct(string  $time = null, string  $object = null) 

Initialize instance

Parameters

string $time
string $object

diff()

diff(\DateTimeInterface  $object, boolean  $absolute = null) : \Spork\DateTime\DateInterval

Override function to return Spork/DateTime/DateInterval instance.

Parameters

\DateTimeInterface $object
boolean $absolute

Returns

\Spork\DateTime\DateInterval
See also

elapsed()

elapsed(boolean  $absolute = null) : \Spork\DateTime\DateInterval

Measure the amount of time elapsed from this DateTime to now.

Parameters

boolean $absolute

Returns

\Spork\DateTime\DateInterval