Issues

ZF-5753: Zend_Date returns Week number with 2 digits

Issue Type: Bug Created: 2009-02-11T15:57:27.000+0000 Last Updated: 2009-02-12T01:09:43.000+0000 Status: Resolved Fix version(s): - 1.8.0 (30/Apr/09)

Reporter: Mickael Perraud (mikaelkael) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: Attachments:

Description

With SVN14051:

<pre class="highlight">
require_once 'Zend/Date.php';
$date = new Zend_Date(1234567890); // => 2009-02-14
echo $date->toString('w');

This echoes '07' instead of '7' (based on http://framework.zend.com/manual/en/…).

In Zend_Date, line 843:

<pre class="highlight">
// week formats
case self::WEEK :
    return $this->date('W', $this->getUnixTimestamp(), false);
    break;

With newer PHP versions, 'W' is always return with 2 digits (see http://bugs.php.net/bug.php?id=34302 resolved in PHP 5.1.0).

Based on ISO8601, we must have 2 digits, so I think we should remove the possibility of only one digit since it does not function.

Comments

Posted by Thomas Weidner (thomas) on 2009-02-11T22:48:36.000+0000

Wrong behaviour of PHP fixed with r14060

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