summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-10-05 17:11:32 -0700
committerZach Copley <zach@status.net>2009-10-05 17:11:32 -0700
commitf7688bec0d7683f0bad1bbb9806a7a6f5a261901 (patch)
treede40f3fd5d0f9accd18317b020cc8404353bc3b6
parent475bdf6fba3ee8081f3726f98ecd3a50fdda305e (diff)
Better Twitter date output
-rw-r--r--lib/twitterapi.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index b2104fddd..2141194df 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -884,12 +884,12 @@ class TwitterapiAction extends Action
$this->end_document('xml');
}
- // Anyone know what date format this is?
- // Twitter's dates look like this: "Mon Jul 14 23:52:38 +0000 2008" -- Zach
function date_twitter($dt)
{
- $t = strtotime($dt);
- return date("D M d H:i:s O Y", $t);
+ $dateStr = date('d F Y H:i:s', strtotime($dt));
+ $d = new DateTime($dateStr, new DateTimeZone('UTC'));
+ $d->setTimezone(new DateTimeZone(common_timezone()));
+ return $d->format('D M d H:i:s O Y');
}
// XXX: Candidate for a general utility method somewhere?