Zend Framework

error while using toString

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Blocker Blocker
  • Resolution: Not an Issue
  • Affects Version/s: 1.10.7
  • Fix Version/s: 1.11.1
  • Component/s: Zend_Date
  • Labels:
    None

Description

An axemple is more explicite :

$oFirstDay = new Date();

$oFirstDay->setDate("2011-01-01", "YYYY-MM-dd");

var_dump($oFirstDay);
/* ------------------------------
object(Zend_Date)[119]
private '_locale' => string 'fr_FR' (length=5)
private '_fractional' => int 0
private '_precision' => int 3
private '_unixTimestamp' => string '1293840000' (length=10)
private '_timezone' => string 'UTC' (length=3)
private '_offset' => int 0
private '_syncronised' => int 0
protected '_dst' => boolean false
----------------------------------- */

$iTmsp = $oFirstDay->getTimestamp();

var_dump($iTmsp);
/* ------------------------------
string '1293840000' (length=10)
--------------------------------*/

var_dump(date("Y-m-d", $iTmsp));
/* ------------------------------
string '2011-01-01' (length=10)
--------------------------------*/

var_dump($oFirstDay->toString("YYYY-MM-dd"));
/* ------------------------------
string '2010-01-01' (length=10)
--------------------------------*/

And 2010-01-01 !== 2011-01-01

Activity

Hide
david ritaine added a comment -

oki sorry : it's "yyyy-MM-dd" and not "YYYY-MM-dd"

Show
david ritaine added a comment - oki sorry : it's "yyyy-MM-dd" and not "YYYY-MM-dd"
Hide
Thomas Weidner added a comment -

Closing as non-issue

Show
Thomas Weidner added a comment - Closing as non-issue

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: