php - Magento get the first day of the current week -
is there way first day of current week according current customer locales settings?
the current date is:
$today = date("y-m-d", mage::getmodel('core/date')->timestamp(time())); the current first day of week server's settings is:
$firstdayofweek = date("y-m-d", strtotime('this week', mage::getmodel('core/date')->timestamp(time()))); i'm using magento 1.7.* ce version.
i'm don't know magento if need timestamp strtotime quite nice this.
$weekbeginning = date('y-m-d', mage::getmodel('core/date')->timestamp(strtotime('last monday')));
Comments
Post a Comment