Method |
Description |
|
__construct ( $sourceUnit = self::MICROSECONDS, $destUnit = self::MICROSECONDS, $mode = self::MODE_TIME, $precision = 3 ) |
|
|
convert ( integer $time, string $unit, string $destUnit, string $mode ) : integer |
Convert given time in given unit to given destination unit in given mode. |
|
convertInto ( $time, $unit, $destUnit ) : integer |
Convert a given time INTO the given unit. That is, how many times the
given time will fit into the the destination unit. i.e. x per unit. |
|
convertTo ( $time, $unit, $destUnit ) : integer |
Convert the given time from the given unit to the given destination
unit. |
|
format ( $time, $unit = null, $mode = null, $precision = null, $suffix = true ) |
Return a human readable representation of the unit including the suffix. |
|
getDestSuffix ( string $unit = null, $mode = null ) : string |
Return the destination unit suffix. |
|
getDestUnit ( string $unit = null ) : string |
Return the destination unit. |
|
getMode ( $mode = null ) : string |
Return the destination mode. |
|
getSuffix ( $unit, $mode = null ) : string |
Return the suffix for a given unit. |
|
overrideDestUnit ( $destUnit ) |
Override the destination unit. |
|
overrideMode ( string $mode ) |
Override the mode. |
|
overridePrecision ( integer $precision ) |
Override the precision. |
|
resolveDestUnit ( $unit ) : string |
Utility method, if the dest unit is overridden, return the overridden
value. |
|
resolveMode ( $mode ) : string |
Utility method, if the mode is overridden, return the overridden
value. |
|
resolvePrecision ( $precision ) : string |
Utility method, if the precision is overridden, return the overridden
value. |
|
toDestUnit ( $time, $destUnit = null, $mode = null ) : integer |
Convert instance value to given unit. |
|