auto find out the dates between two other dates
Posted: Tue Nov 22, 2005 7:23 am
Hi all, this is an interesting one.
I have two dates, I have today and I have an adjusted date. Today is obviously todays date, and adjusted date is X weeks from today.
The info resides in an array like so:
$date_array[today] and $date_array[adjusted]
What I want to know, is how can I do an automagic that finds out all the dates inbetween those two dates?
For example, consider the two dates to be 2005-11-22 and 2005-11-15 how can I get a script to take one and fill in the blanks to create X new dates (in another array say) that are all legit?
It would be perfect if it would create this:
2005-11-22
2005-11-21
2005-11-20
2005-11-19
2005-11-18
2005-11-17
2005-11-16
2005-11-15
or similar.
It's a toughy for me, I'm really not this advanced... (but I'm guessing it will be something easy, knowing the cool functions PHP seems to have).
Rob
I have two dates, I have today and I have an adjusted date. Today is obviously todays date, and adjusted date is X weeks from today.
The info resides in an array like so:
$date_array[today] and $date_array[adjusted]
What I want to know, is how can I do an automagic that finds out all the dates inbetween those two dates?
For example, consider the two dates to be 2005-11-22 and 2005-11-15 how can I get a script to take one and fill in the blanks to create X new dates (in another array say) that are all legit?
It would be perfect if it would create this:
2005-11-22
2005-11-21
2005-11-20
2005-11-19
2005-11-18
2005-11-17
2005-11-16
2005-11-15
or similar.
It's a toughy for me, I'm really not this advanced... (but I'm guessing it will be something easy, knowing the cool functions PHP seems to have).
Rob