format(DateTime::ATOM); $value = preg_replace('/[\+\-]00(\:?)00$/', 'Z', $atom); } EasyRdf_Literal::__construct($value, null, $datatype); } /** Parses a string using DateTime and creates a new literal * * Example: * $dt = EasyRdf_Literal_DateTime::parse('Mon 18 Jul 2011 18:45:43 BST'); * * @see DateTime * @param string $value The date and time to parse * @return object EasyRdf_Literal_DateTime */ public static function parse($value) { $value = new DateTime($value); return new EasyRdf_Literal_DateTime($value); } /** 24-hour format of the hour as an integer * * @return integer */ public function hour() { return (int)$this->format('H'); } /** The minutes pasts the hour as an integer * * @return integer */ public function min() { return (int)$this->format('i'); } /** The seconds pasts the minute as an integer * * @return integer */ public function sec() { return (int)$this->format('s'); } }