]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
output Atom dates in UTC
authorEvan Prodromou <evan@status.net>
Tue, 3 Aug 2010 22:55:40 +0000 (15:55 -0700)
committerEvan Prodromou <evan@status.net>
Tue, 3 Aug 2010 22:55:40 +0000 (15:55 -0700)
classes/Notice.php

index 61844d487e8e577476b368633767ba714136e56e..b849225fdb6af58fed4bbc625f8d586ba1fc8221 100644 (file)
@@ -1242,7 +1242,7 @@ class Notice extends Memcached_DataObject
                     $notice = $profile->getCurrentNotice();
 
                     if (!empty($notice)) {
-                        $xs->element('updated', null, common_date_w3dtf($notice->created));
+                        $xs->element('updated', null, self::utcDate($notice->created));
                     }
 
                     $user = User::staticGet('id', $profile->id);
@@ -1307,7 +1307,7 @@ class Notice extends Memcached_DataObject
             Event::handle('EndActivityId', array(&$this, &$xs, $id));
         }
 
-        $published = common_date_w3dtf($this->created);
+        $published = self::utcDate($this->created);
 
         if (Event::handle('StartActivityPublished', array(&$this, &$xs, &$published))) {
             $xs->element('published', null, $published);
@@ -2055,4 +2055,11 @@ class Notice extends Memcached_DataObject
         $tag->free();
         return $tags;
     }
+
+    static private function utcDate($dt)
+    {
+        $dateStr = date('d F Y H:i:s', strtotime($dt));
+        $d = new DateTime($dateStr, new DateTimeZone('UTC'));
+        return $d->format(DATE_W3C);
+    }
 }