Did you try $date->getTimestamp();  That may work but I'm not sure if it
will read the year correctly.



On Wed, Oct 28, 2009 at 8:37 AM, Peter Smit <[email protected]> wrote:

> On Wed, Oct 28, 2009 at 2:29 PM, Shaun Farrell <[email protected]>wrote:
>
>> Peter,
>>
>> Try this.  It may work
>>
>> $indate = "Fri Oct 23 15:47:42 +0000 2009";
>> $outformat = "EEEE d MMM YYYY";
>> $date = new Zend_Date();
>> $date->setTimezone('Europe/Helsinki');
>> $datetime = strtotime($indate);
>> $date->set($datetime);
>>
>> echo "Date: " . $date->toString($outformat);
>> echo "TimeZone: " . $date->getTimezone();
>>
>>
>>
> It works, it is indeed a workaround to convert the date to a timestamp with
> strtotime and construct a date from that. I have only the following 2
> concerns
>  - I was expecting Zend_Date to do this for me, so is my expectation wrong
> than this is a solution, if not it's a workaround
>  - This will not work with dates outside the range of the timestamp (> year
> 2039 according to
> http://php.net/manual/en/function.strtotime.php#function.strtotime.notes)
>
>
>


-- 
Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com

Reply via email to