umpirsky wrote:
expected result is 2010-03-01. The whole year is missed :)
Quoting PHP manual:
---
o - ISO-8601 year number. This has the same value as /Y/, except that if
the ISO week number (/W/) belongs to the previous or next year, that
year is used instead. (added in PHP 5.1.0)
---
Output of date('W', 1262476800) is 53, so that timestamp falls into the
last week of 2009, so the output is expected.
As for Zend_Date, again, quoting manual:
Y: "Year according to ISO 8601, at least one digit "
Apparently, the ISO8601 standard uses the week number as a benchmark for
the year. Since the output matches the documentation, I'd say it is
expected behaviour :-)
You'd probably want to use 'y' (lowercased) in stead of uppercased to
get the output you wish for.
Also, be aware that 'm' is not the same as 'M' (meaning minutes and
months respectively)
HTH
drm / Gerard