4 * This property represents the {DAV:}getlastmodified property.
6 * Although this is normally a simple property, windows requires us to add
9 * This class uses unix timestamps internally, and converts them to RFC 1123 times for
14 * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
15 * @author Evert Pot (http://www.rooftopsolutions.nl/)
16 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
18 class Sabre_DAV_Property_GetLastModified extends Sabre_DAV_Property {
30 * @param int|DateTime $time
32 public function __construct($time) {
34 if ($time instanceof DateTime) {
36 } elseif (is_int($time) || ctype_digit($time)) {
37 $this->time = new DateTime('@' . $time);
39 $this->time = new DateTime($time);
42 // Setting timezone to UTC
43 $this->time->setTimezone(new DateTimeZone('UTC'));
50 * @param Sabre_DAV_Server $server
51 * @param DOMElement $prop
54 public function serialize(Sabre_DAV_Server $server, DOMElement $prop) {
56 $doc = $prop->ownerDocument;
57 $prop->setAttribute('xmlns:b','urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/');
58 $prop->setAttribute('b:dt','dateTime.rfc1123');
59 $prop->nodeValue = Sabre_HTTP_Util::toHTTPDate($this->time);
68 public function getTime() {