I need to know if anybody knows of an algorithm to take a date from a database and compare it to todays date.
What I'm doing is pulling a startdate from our database in 0000-00-00 format. Say the date is 2003-09-07, the person would have signed up on that date for periodic billing on the same day of everymonth thereafter. I'm trying to do an update billing script for if a customer needs to update cc info. I'm required by our merchant to pass a startdate, but it has to be in the future and not the past. So if they signed up originally on 2003-09-07 and did an update on 2003-11-15, I would need the date to be passed for updating to be 2003-12-07, keeping the same billing day of the month.
So I need to compare the startdate to the current date and determine how many days it will need to add to take it to the next month but same day of the month.
I also need it to get rid of the '-' in 2003-09-07 and send it like this 20030907.
I hope someone can help me.
Thanks.