aztechy wrote:
>
> Is this the wrong use? Does $part have to be a zend_date constant? And
> if so, can I tie multiple constants together to build a date of
> 'YYYY-MM-dd'?
>
I am using Zend_Date::DATE_SHORT as the part, and 'hr_HR' as the locale and
my locale has Zend_Date::DATE_SHORT set as YYYY-MM-dd.
But if you are using this date object just for comparison purposes I would
go with PHPs built in functions. Because MySQL always returns ISO_8601
representation of the date, date() and strotime() are faster.
Try something like this:
$date1 = value from the DB;
$date2 = value from the DB;
if ( date("Y-m-d", strtotime($date1) == date("Y-m-d", strtotime($date2) ) {
$datesEqual = true;
} else {
$datesEqual = false;
}
Regards,
Goran Juric
http://gogs.info/
--
View this message in context:
http://www.nabble.com/Zend-Date-Comparison-with-equals-tp20063705p20064490.html
Sent from the Zend Framework mailing list archive at Nabble.com.