Hi (Thomas and) Everyone,

I'm trying to get my head around the timezone thing with zend date.
I'm in Prague, so I set the:

protected function setUp()
    {
      date_default_timezone_set('Europe/Prague');
    }

then I do a test with zend_date:
public function testZendDateReadTime()
    {
      $time = array(
        'year' => '2008',
        'month' => '07',
        'day' => '01',
        'hour' => '23',
        'minute' => '10'
      );
      $ts = 
mktime($time['hour'],$time['minute'],0,$time['month'],$time['day'],$time['year']);
      $date = new Zend_Date($time);
      $this->assertEquals($ts,$date->getTimestamp());
      $this->assertEquals('2008-07-01',$date->toString('YYYY-MM-dd'));

    }

and the timestamps don't match. If I change the default timezone to
UTC it works fine. I'm sure that I'm missing how to configure zend
date or reading in the time or something. Any help would be
appreciated!

Thanks,

Brian

Reply via email to