Error in Zend_Date (back in time)

I have a very strange problem, Zend_Date converts my timestamp a year earlier.

In my action:

// Timestamp
$intTime = 1293922800;

// Zend_Date object
$objZendDate = new Zend_Date($intTime);

// Get date

echo date('Y-m-d',$intTime).'<br>';
echo $objZendDate->get('YYYY-MM-dd');

These outputs: 2011-01-02 2010-01-02

Can someone tell me what I am doing wrong?

+5
source share
2 answers

From the ZF issue tracker, it seems like this is a known issue:

Recently, many ZF users have reported an error that Zend_Date returns in the wrong year, 2009, and not 2008. This is, however, the expected behavior, and NOT A BUG!

From the FAQ:

When using your own formats in your code, you may come to a situation where you receive, for example, December 29, 2009, but you expected to receive December 29, 2008.

: 2009 2008 . . . :

$- > ToString ( '..');

$- > ToString ( '..');

, ISO PHP, , . Year and Minute .

, . Y ISO y . , . Y ISO, . . , 31 2007 . - 2007 , 1- 2008 . , "dd.MM.yyyy", '31. 2007 ', ' dd.MM.YYYY ', '31. 2008'. , , .

. ISO m , PHP, i. , , , .

+13

zwip, , , , YYYY-MM-dd o\-m\-d, PHP date() .

, o date format, , ISO, , .

0
source

All Articles