Skip to content
This repository was archived by the owner on May 16, 2018. It is now read-only.
This repository was archived by the owner on May 16, 2018. It is now read-only.

Zend_Date doesn't create correct date when seconds are missing from 8601 format #449

@bskendig

Description

@bskendig

This code:

$d = new Zend_Date('2014-10-27T09:44:55Z', Zend_Date::ISO_8601);
echo $d;

displays "Oct 27, 2014 9:44:55 AM", whereas if you remove the seconds:

$d = new Zend_Date('2014-10-27T09:44Z', Zend_Date::ISO_8601);
echo $d;

then it displays "Oct 27, 2014 12:00:00 AM".

According to "http://en.wikipedia.org/wiki/ISO_8601" as well as "http://www.cl.cam.ac.uk/~mgk25/iso-time.html", the seconds can be omitted from an ISO 8601-formatted date for reduced precision but the string is still a valid date representation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions