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

If a record matches an existing record do nothing
So I don't know if I should put this here or in mysql, but what my script is for is for people to ad

Read from a text file after a specific word
Hi all.

I have a text file that looks like the one below.
I know how to open the text fi

Php If in MySql query (hiding labels if a field is empty)
Okay, I've been trying to do this for a while, and I'm finally going to ask for help so I can get th

Keeping track of php uploads
Hello all.

I was looking at the way PHP handles file uploads.
It seems that PHP uses a tem

blank page.... nothing is happening.
I'm new to a lot of this but in the last 24hrs have learned a lot.
Installed latest version of my

strtotime issue
Hey all,

I'm playing around with some code, and basically the idea is:

Person changes

How to show next and prev records
Hi all,

Sorry if this is simple, i'm very new to php, well, any programming language actually

Navigation include for all site directories
Hi,

I need a navigation include that can deal with directories at different levels on a site.

Mail Script Problems
I have created a PHP mail script. I am having a problem though. In $body i am trying to put two va

Hardcopy printing is to wide
I want to make a hardcopy at runtime of my active form like this

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