It seems that Zend_Date does not parse a date well when the year comes after
the timezone.

Example code:
<?php
date_default_timezone_set('Europe/Helsinki');
set_include_path('/home/peter/Desktop/ZendFramework-1.9.3PL1/library' .
PATH_SEPARATOR . get_include_path());

require_once('ZendFramework-1.9.3PL1/library/Zend/Date.php');
require_once('ZendFramework-1.9.3PL1/library/Zend/Locale.php');

$informat = "EEE MMM d h:mm:ss ZZZ YYYY";
$indate = "Fri Oct 23 15:47:42 +0000 2009";

$outformat = "EEEE d MMM YYYY";

$date = new Zend_Date($indate, $informat);
#$date = new Zend_Date();
echo $date->toString($outformat) . "\n";
echo $date->toString($informat) . "\n";

Gives:
Thursday 23 Oct 0000
Thu Oct 23 3:47:42 +0000 0000

This date format is common for the Twitter API.

Is this a bug?

Regards,

Peter Smit

Reply via email to