Set Zend_Date Month using User Input

2019-09-10 18:36发布

I'm looking for a way to set the month of Zend_Date using a string from the user (could be Jan, January, etc). For example

$month = strftime("%m", strtotime($month));
$date->set($month, Zend_Date::MONTH);

Will get the month 'number', which then can be used to set the Zend_Date month. Is there a way to do that all with Zend_Date?

1条回答
Juvenile、少年°
2楼-- · 2019-09-10 19:25
$month = 'January';  // Or 'Jan' or 1 or '1' or '01'
$date->setMonth($month);
查看更多
登录 后发表回答