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

SAP BCS. BPS
Hi all,

I am seeking reading note on the following in BW

BCS, BPS
ADVANCE

How do I replace any number of character occurences with one occurrence?
How do I replace any number of character occurences with one occurrence?

Let's say I have:

why does my session end?
my connect.php starts the session just so you know
i can navigate arround my site fine except whe

Beginner PHP code help
Hi I'm new to php but if someone could please read the question below and help it would be great.

TimeStamp Column Problem...
I'm mad at my self and thinking I'm a little retarded. It just be some one mistake I'm missing here.

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

Line break?
Hi, I'm new to the forum and new to php. I'm not sure if I'm using the correct terminology so here i

split string
Hi all

i have some names (imploded by comma):
Code: toronto,paris,madrid
Now, i would

A Few Questions
Hi, I want to ask a few questions that I can't seem to find..

1) I'm creating a "shortcu

Question about the upload of large files
Hi there,

I have a question about the upload of large files, like videos (files generally abo

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