]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Activity::asString() should format numerical not string time
authorEvan Prodromou <evan@status.net>
Mon, 13 Sep 2010 21:05:02 +0000 (17:05 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 13 Sep 2010 21:05:02 +0000 (17:05 -0400)
lib/activity.php

index 8e2da99bb3afe46cb559a97178bc9e970178b86d..606c614320a56a496e94c0c9d7d6aad6a7171e61 100644 (file)
@@ -338,7 +338,7 @@ class Activity
 
         $xs->element('id', null, $this->id);
         $xs->element('title', null, $this->title);
-        $xs->element('published', null, common_date_iso8601($this->time));
+        $xs->element('published', null, self::iso8601Date($this->time));
         $xs->element('content', array('type' => 'html'), $this->content);
 
         if (!empty($this->summary)) {
@@ -386,5 +386,13 @@ class Activity
     {
         return ActivityUtils::child($element, $tag, $namespace);
     }
+
+    static function iso8601Date($tm)
+    {
+        $dateStr = date('d F Y H:i:s', $tm);
+        $d = new DateTime($dateStr, new DateTimeZone('UTC'));
+        $d->setTimezone(new DateTimeZone(common_timezone()));
+        return $d->format('c');
+    }
 }