ZF-6884: Zend_Date produces mix up day and month with english locale

Issue Type: Bug Created: 2009-06-02T06:27:42.000+0000 Last Updated: 2011-11-11T16:53:23.000+0000 Status: Resolved Fix version(s): - 1.8.3 (09/Jun/09)

Reporter: Stephan Schulze (hopper) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: Attachments:


Zend_Date seems to mix up the day and month when using english locales.

<pre class="highlight">
// Example input
$oDate = new Zend_Date('2009-05-06 18:35:01');
echo $oDate->get(Zend_Date::DATE_MEDIUM);

produces Jun 5, 2009 instead of May 6, 2009

When I use

<pre class="highlight">
$oDate = new Zend_Date(strtotime('2009-05-06 18:35:01'));
echo $oDate->get(Zend_Date::DATE_MEDIUM);

the result is correct


Posted by Thomas Weidner (thomas) on 2009-06-02T11:53:04.000+0000

At the first you say:

"Detect me the input and the locale because I don't know anything"... the given date string does not conform english default date so the system tries to detect it and this seems not to conform your expectations.

Note that there are about more than 400 different date formats and several of them are contrahary to each other.

By the second you have a integer value which is automatically detected as timestamp.

The rule is simple: * When you know the input format, then define it * When you know the locale, then define it

Additionally, when you try to debug a date object give the complete date representation and not only a part (use ->getIso())

Posted by Thomas Weidner (thomas) on 2009-06-04T03:20:08.000+0000

Closing due to no response

Posted by Bernhard Valenti (bernhardv) on 2011-11-10T17:13:41.000+0000

to me a date in the format "2009-05-06 18:35:01" always means "YEAR-MONTH-DAY HOUR:MINUTE:SECOND", I have never ever seen that format where it means "YEAR-DAY-MONTH...". So i suggest this gets fixed, unless somebody can show that this format is actually used in a localized way.

Posted by Thomas Weidner (thomas) on 2011-11-11T16:53:23.000+0000

Sorry, but reproduction on given example does not show problems. And there are still no details returned after two years.

So I suggest to keep this issue closed.

Have you found an issue?

See the Overview section for more details.


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

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