No this is not a bug.
Please look into the manual about self defined formats:
http://framework.zend.com/manual/en/zend.date.constants.html#zend.date.constants.selfdefinedformatsThere is a own paragraph about this.
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com----- Original Message -----
From: "Torsten Bühl" <
webmaster@...>
To: <
fw-i18n@...>
Sent: Friday, May 09, 2008 4:22 PM
Subject: [fw-i18n] Zend_Date 2006-01-01 gives 2005-01-01
>
> I paste my code here, is it a Bug?
> In the Bootstrap I have:
> setlocale(LC_ALL, 'de_DE.UTF8');
> date_default_timezone_set("Europe/Berlin");
>
> the script is:
>
> $Date = new Zend_Date();
> $Date->set("2006-01-01");
> echo $Date->get('dd.MM.YYYY');
> //gives: 01.01.2005 <- FAIL
> //expected: 01.01.2006
>
> $Date = new Zend_Date();
> $Date->set("2005-01-01");
> echo $Date->get('dd.MM.YYYY');
> //gives: 01.01.2004 <- FAIL
> //expected: 01.01.2005
>
> $Date = new Zend_Date();
> $Date->set("2004-01-01");
> echo $Date->get('dd.MM.YYYY');
> //gives: 01.01.2004 <- OK
> //expected: 01.01.2004
>
> To test something else I also have:
>
> $datestr = "2006-01-01";
> $date = strtotime($datestr);
> echo date("Y-m-d",$date);
> //gives: 2006-01-01 <- OK
> //expected: 2006-01-01
>
> Tanks for reply
> Best, Torsten
> --
> View this message in context:
>
http://www.nabble.com/Zend_Date-2006-01-01-gives-2005-01-01-tp17149090p17149090.html> Sent from the Zend I18N/Locale mailing list archive at Nabble.com.