Date calculation
| From: | PHP) | Date: | Mon, 16 Oct 2006 01:19:03 +0000 |
| Subject: | Date calculation | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-243174@lists.php.net to get a copy of this message | ||
I have one more date based question.
I have a month field ( $month ) and a day field ( $day ) being submitted
by a form.
I have a third field to be used as a date reminder for the information
which was submitted as part of the form. It is a reminder to complete a
task for the date was which was submitted as part of the form.
How do I calculate the $reminder date based on $month and $day and have
it output in the YYYY-MM-DD format? $reminder is the number of days
before $month $day (I want to use $reminder in a date format to SELECT
records from a mySQL table) This is why I am wanting put $reminder into
a date format
If $month was 6 and $day was 7 and $reminder was 6 then I would want the
output to be 2007-06-01 --- We have already passed June 1st in 2006.
However if $month was 11 then I would want the output to use this years
date --- 2006-11-01
Any suggestions?
Ron