src/Carbon/Traits/Date.php
public function getPaddedUnit($unit, $length = 2, $padString = '0', $padType = STR_PAD_LEFT)
    {
        return ($this->$unit < 0 ? '-' : '').str_pad(abs($this->$unit), $length, $padString, $padType);
    }
public function getPaddedUnit($unit, $length = 2, $padString = '0', $padType = STR_PAD_LEFT)
    {
        return ($this->$unit < 0 ? '-' : '').str_pad(abs($this->$unit), $length, $padString, $padType);
    }
public function getPaddedUnit ( $ unit , $ length = 2 , $ padString = '0' , $ padType = STR_PAD_LEFT ) { return ( $ this -> $ unit < 0 ? '-' : '' ) . str_pad ( abs ( $ this -> $ unit ) , $ length , $ padString , $ padType ) ; }
Returns a unit of the instance padded with 0 by default or any other string if specified.

@param string $unit      Carbon unit name
@param int    $length    Length of the output (2 by default)
@param string $padString String to use for padding ("0" by default)
@param int    $padType   Side(s) to pad (STR_PAD_LEFT by default)

@return string
Returns a unit of the instance padded with 0 by default or any other string if specified .