output Atom dates in UTC

This commit is contained in:
Evan Prodromou 2010-08-03 15:55:40 -07:00
parent f83171824f
commit cc71f1ae82

View File

@ -1242,7 +1242,7 @@ class Notice extends Memcached_DataObject
$notice = $profile->getCurrentNotice(); $notice = $profile->getCurrentNotice();
if (!empty($notice)) { 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); $user = User::staticGet('id', $profile->id);
@ -1307,7 +1307,7 @@ class Notice extends Memcached_DataObject
Event::handle('EndActivityId', array(&$this, &$xs, $id)); 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))) { if (Event::handle('StartActivityPublished', array(&$this, &$xs, &$published))) {
$xs->element('published', null, $published); $xs->element('published', null, $published);
@ -2055,4 +2055,11 @@ class Notice extends Memcached_DataObject
$tag->free(); $tag->free();
return $tags; 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);
}
} }