troubleshooting Question

Problems adding days to a date.

Avatar of easttncs
easttncs asked on
1 Comment1 Solution208 ViewsLast Modified:
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

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros