Issues

ZF-5723: Zend_Date outputs wrong year

Issue Type: Bug Created: 2009-02-10T05:30:29.000+0000 Last Updated: 2009-02-10T07:09:46.000+0000 Status: Resolved Fix version(s): Reporter: Hristo Angelov (hedonism) Assignee: Dolf Schimmel (Freeaqingme) (freak) Tags: - Zend_Date

Related issues: - ZF-5297

Attachments:

Description

Try this code:

<pre class="highlight">
$date = new Zend_Date();
$date->set($from, Zend_Date::TIMESTAMP);

//$from is dynamically passed timestamp

Zend_Debug::dump($from);
Zend_Debug::dump(date('Y-m-d H:i:s', $from)); 
Zend_Debug::dump($date->get(Dnez_Date::DB_DATETIME));
exit();

//source of Dnez_Date class

class Dnez_Date extends Zend_Date
{

    const DB_DATE = 'YYYY-MM-dd';
    const DB_DATETIME = 'YYYY-MM-dd HH:mm:ss';

}

The result is:

<pre class="literal">
int 1262296800
string '2010-01-01 00:00:00' (length=19)
string '2009-01-01 00:00:00' (length=19)

For some reason Zend_Date give me wrong year.

p.s. I just downloaded the latest trunk version of framework.

Comments

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-02-10T07:08:16.000+0000

Please see the documentation on what your problem is (hint: Y vs y).

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts