Constructor for creating a new date literal
If the value is a DateTime object, then it will be converted to the xsd:date format.
mixed $value The value of the literal:
string $lang Should be null (literals with a datatype can't have a language):
string $datatype Optional datatype (default 'xsd:date'):
object EasyRdf_Literal_Date
Overrides EasyRdf_Literal::__construct
DateTime
public function __construct($value, $lang = null, $datatype = null) {
// Convert DateTime object into string
if ($value instanceof DateTime) {
$value = $value
->format('Y-m-d');
}
parent::__construct($value, null, $datatype);
}