Problem in getting week number of sundays , in zend

Posted by Linto davis on Stack Overflow See other posts from Stack Overflow or by Linto davis
Published on 2010-03-24T07:04:51Z Indexed on 2010/03/24 7:13 UTC
Read the original article Hit count: 285

Filed under:

I want to get the week number of a particular date , using Zend_Date

My local is setted as English(IN) [en_IN], in Opera browser

I am using the following code

$date = new Zend_Date('22 Mar, 2010', null, Zend_Registry::get('Zend_Locale'));
echo $date->get(Zend_Date::WEEK); //output 12, correct

But if we give a sunday , it will not work correctly

for example

$date = new Zend_Date('21 Mar, 2010', null, Zend_Registry::get('Zend_Locale'));
echo $date->get(Zend_Date::WEEK); //output 11,  not correct

it should output 12

What is wrong with this?

© Stack Overflow or respective owner

Related posts about zend-framework