Welcome Guest, Not a member yet? Register   Sign In
Add X days to current date and calculate excluding saturdays and sundays
#1

[eluser]ninjayan[/eluser]
Hello everyone!
I am currently developing a document tracking application which will calculate the duration of document.

So the number of days to be added from the current date (document creation) is set from the database (dynamic).

I have this code but this will not make it dynamic since the number of days to be added is hard coded.

Code:
$add = 5;
if ($add == "5") {
$xa = date("Y-m-d", strtotime("+7 days"));
}elseif ($add == "10") {
$xa = date("Y-m-d", strtotime("+14 days"));
}

echo $xa;

So the code above is just to illustrate what I want to achieve.


Messages In This Thread
Add X days to current date and calculate excluding saturdays and sundays - by El Forum - 10-17-2012, 09:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB