How to calculate days from variable date?


Posted on 16th Feb 2014 07:03 pm by admin

This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:

Code: <?php
$mydate = "";
Did you know?Explore Trending and Topic pages for more stories like this.
$daysaway = 400;
$startdate = "5/5/2005";

//I need how to get the date that was 400 days ago

print "$mydate was $daysaway days from $startdate.";
?>
No comments posted yet

Your Answer:

Login to answer
223 Like 50 Dislike
Previous forums Next forums
Other forums

help removing unwanted graphic
How do I remove the small elongated rectangular shape between the "Latest post" and "

Can php detect connection speed and thereafter swap out elements?
No code to post, lads, yet. Just looking for a yay or nay at this stage:

Can a php script be

single page with referrer to show correct page
I have a simple website with a couple of different pages. I would like to be able to in a div tag w

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

problem with php server update from mid 2009
Hi,

I have this navigation menu on 2 websites which used to work just fine. After a recent up

Ball movement
I want to move a ball from one point to another and it should hit a group of balls at the other end

Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :

Feed Maker
Hi all.
First of all I must say I am not a php developer so I am afraid I don't know much about i

registration form
first time posting. did some searches but didnt find exactly what i am looking for. dont flame cause

PHP form help required
Hi all! Apologies in advance for having to message the forum for help. I know you must get a lot of

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash