public static function 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 drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/DateTime.php
Parses a string using DateTime and creates a new literal

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Date.php, line 79

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);
}