View Single Post
Old 03-12-2009, 11:20   #27
handyman
bah
 
handyman's Avatar
 
Join Date: Jun 2003
Location: Nr Carnforth
Age: 36
Services: M6 Keele
Posts: 5,455
handyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny star
handyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny starhandyman has a nice shiny star
Send a message via MSN to handyman
Re: Any php coders out there?

Success although I think I might have spotted my problem as I had tried that one but it did not work. I realized I needed to run it before I changed the date format.

Here's an extension of that for you since it now works but is still wrong.

Courses are x days long so the start date of 7/12/09 and a 3 day course with the above gives a finish date of 10/12/09. However a 3 day course starting on 7/12/09 finishes on 9/12/09.

I could simply remove 1 day from length and that would be fine except for a 1 day course lol.

I think I may be able to work round this but may be back here in ten with another question :-)

OMG it works !!
PHP Code:
if ($length <= 1) {
$enddate date("d/m/y",strtotime($date));
}
else {
$correctlength $length 1;
$enddate date("d/m/y"strtotime($date " + $correctlength days")); 


Last edited by handyman; 03-12-2009 at 11:40.
handyman is offline   Reply With Quote