You are here

public static function EasyRdf_Literal_Date::parse in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Date.php \EasyRdf_Literal_Date::parse()

Parses a string using DateTime and creates a new literal

Example: $date = EasyRdf_Literal_Date::parse('1 January 2011');

Parameters

string $value The date to parse:

Return value

object EasyRdf_Literal_Date

See also

DateTime

1 method overrides EasyRdf_Literal_Date::parse()
EasyRdf_Literal_DateTime::parse in vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/DateTime.php
Parses a string using DateTime and creates a new literal

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Date.php, line 84

Class

EasyRdf_Literal_Date
Class that represents an RDF Literal of datatype xsd:date

Code

public static function parse($value) {
  $value = new DateTime($value);
  return new EasyRdf_Literal_Date($value);
}