Class luya\web\jsonld\DateTimeValue
Inheritance | luya\web\jsonld\DateTimeValue » luya\web\jsonld\BaseValue |
---|---|
Available since version | 1.0.3 |
Source Code | https://github.com/luyadev/luya/blob/master/core/web/jsonld/DateTimeValue.php |
A combination of date and time of day in the form [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm] (see Chapter 5.4 of ISO 8601).
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Provide datetime value. | luya\web\jsonld\DateTimeValue |
getValue() | Get the value to assign from BaseValue. | luya\web\jsonld\DateTimeValue |
Method Details
Provide datetime value.
public void __construct ( $datetime ) | ||
$datetime | string|integer |
public function __construct($datetime)
{
$this->_datetime = $datetime;
}
Get the value to assign from BaseValue.
public void getValue ( ) |
public function getValue()
{
if (is_numeric($this->_datetime)) {
$this->_datetime = date("c", $this->_datetime);
}
return $this->_datetime;
}