On Wed, Mar 2, 2011 at 10:56 PM, Simon Walter <[email protected]> wrote:
> On Thursday, March 03, 2011, Ryan Lange wrote: > > ["date_format"] => string(5) "d.M.y" > > I may be very very wrong about this, but wouldn't that be allowing a single > digit for for any of the date parts? > > Here is what I read: > M Month, one or two digit > d Day of the month, one or two digit > y Year, at least one digit > > Maybe you should be doing: > "dd.MM.yyyy" > > Maybe you could use a constant, and that will help with localization: > Zend_Date::DATE_SHORT > > That doesn't seem to make a difference. A format of "dd.MM.yyyy" should fail to parse "29.2.2008", but it doesn't. Similarly, a year part of "y", "yy", or "yyyy" all produce the same result (a successful parsing), whether the year part of the input is "08" or "2008". It seems that the format is only good for hinting at the order of the parts in the input and not the overall format of the input or even the size of the parts. Ryan
