<?php

/*
 * This file is part of KoolKode HTTP.
*
* (c) Martin Schröder <m.schroeder2007@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace KoolKode\Http\Header;

use KoolKode\Http\Http;

/**
 * The If-Modified-Since request-header field is used with a method to make it conditional: if the
 * requested variant has not been modified since the time specified in this field, an entity will not
 * be returned from the server; instead, a 304 (not modified) response will be returned without
 * any message-body.
 * 
 * @author Martin Schröder
 */
class IfUnmodifiedSinceHeader extends AbstractDateHeader
{
	public static function fromString($value)
	{		
		return new static(\DateTimeImmutable::createFromFormat(Http::DATE_FORMAT_RFC1123, $value, new \DateTimeZone('UTC')));
	}
	
	public static function getFieldName()
	{
		return 'If-Unmodified-Since';
	}
}
