Class luya\web\jsonld\DateValue

Inheritanceluya\web\jsonld\DateValue » luya\web\jsonld\BaseValue
Available since version1.0.3

A date value in ISO 8601 date format.

Auto convert timestamp values to iso 8601 date.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Provide date data. luya\web\jsonld\DateValue
getValue() Get the value to assign from BaseValue. luya\web\jsonld\DateValue

Method Details

Hide inherited methods

__construct() public method

Provide date data.

public void __construct ( $date )
$date string|integer

                public function __construct($date)
{
    $this->_date = $date;
}

            
getValue() public method

Get the value to assign from BaseValue.

public void getValue ( )

                public function getValue()
{
    if (is_numeric($this->_date)) {
        $this->_date = date("Y-m-d", $this->_date);
    }
    
    return $this->_date;
}