easttncs
asked on
Problems adding days to a date.
I have a form passing a date in the format of 2007-01-12. I need to add 56 days to that to come up with a begining and ending date to use in a query. Almost everything that I have tried has give me very wierd results.
For example the following date being passed 2007-01-21, to the following code,
$start_date = $_POST['snapshot_date'];
$end_date = $start_date + (86400 * 7);
echo "$end_date";
yields a result of 606807
I have tried using the strtotime() function and it yields similar incorrect results
where am i off point
For example the following date being passed 2007-01-21, to the following code,
$start_date = $_POST['snapshot_date'];
$end_date = $start_date + (86400 * 7);
echo "$end_date";
yields a result of 606807
I have tried using the strtotime() function and it yields similar incorrect results
where am i off point
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.