Exemplo n.º 1
0
 /**
  * Tries parsing the header's value as an RFC 2822 date, and failing that
  * into an RFC 822 date.
  * 
  * @param string $token
  */
 public function __construct($token)
 {
     parent::__construct(trim($token));
     $date = DateTime::createFromFormat(DateTime::RFC2822, $this->value);
     if ($date === false) {
         $date = DateTime::createFromFormat(DateTime::RFC822, $this->value);
     }
     $this->date = $date === false ? null : $date;
 }