]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Format timestamps as UTC in ActivityStreams output. While using local times is legit...
authorBrion Vibber <brion@pobox.com>
Wed, 30 Mar 2011 19:36:54 +0000 (12:36 -0700)
committerBrion Vibber <brion@pobox.com>
Wed, 30 Mar 2011 19:36:54 +0000 (12:36 -0700)
lib/activity.php

index b781e498467f0331dbf9dd10db41d015b0cf1faa..83a115d16015088421332aef5bd57f8e850a00ed 100644 (file)
@@ -704,11 +704,18 @@ class Activity
         return ActivityUtils::child($element, $tag, $namespace);
     }
 
+    /**
+     * For consistency, we'll always output UTC rather than local time.
+     * Note that clients *should* accept any timezone we give them as long
+     * as it's properly formatted.
+     *
+     * @param int $tm Unix timestamp
+     * @return string
+     */
     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');
     }
 }