views:

147

answers:

1

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?

+3  A: 
$month = 'January';  // Or 'Jan' or 1 or '1' or '01'
$date->setMonth($month);
GZipp
Wow, you would think that could be better documented (in the ref guide, not the API). Unless I just missed it?After reading through the set() function - I just figured the rest of the setters were as restrictive. Guess not - thanks!
Tim Lytle