Hi,
I've researched the PHP manual, but I'm having difficulty figuring out how to perform date calculations using PHP.
I have several dates stored in a MySQL database in the format yyyy-mm-dd. They are:
LetterDate
EventDate
CancelDate
DueDate
ExpireDate
The user will determine the LetterDate, EventDate and CancelDate from a series of select boxes (which I then convert to MySQL format to input to database)
I also have a field called "EventType."
Its value determines the value of another field called "Term" where Term is the number of months. So:
For EventType A, B & C, Term = 18
For EventType D, Term = 29
For EventType E & F, Term = 36
I want to perform calculations using PHP as follows:
1. DueDate = 60 days from the LATER of LetterDate OR EventDate
2. ExpireDate = CancelDate + Term
I also want to create a new variable as follows:
3. NoticeDate = CancelDate - 60 days
Can someone please help me figure out: these three calculations?