I have two dates given as Zend_Date(). I must check the following:
- if theese dates are in the same month day (for example: second day of the month, year does not matter),
- if dates are from exactly the same day(for example 2 december 2012);
I have two dates given as Zend_Date(). I must check the following:
Copyright © 2021 Jogjafile Inc.
To check the dates are the exact same day, you can check each individual part separately.
This returns a date object that specifically gives you the day for the 'your-date-here' and it accepts a variety of formats; for example, I use php's date function as:
and now $dateDayObject will have the value of the 'd' in it.
You can use DAY, WEEK, YEAR... there are many constant all defined here:
http://framework.zend.com/manual/1.12/en/zend.date.constants.html
Finally, to test if they are in the same day of the month, you can use a combination of loops and if statement and the same method as above to write your own function to check the day within the month or there may be a defined constant for it. Good luck.