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

mysql VARCHAR acting like INT
Hi, All.

I have a table that contains a varchar(10) column named weird_field. In this column

Filtering an Array Based on Value
I have a very simple script set up that pulls data from a database and is output using this code:

Php - mysql store data and use it later?
Hi, i' making a login page at the moment, however my username + password is stored many different pl

Switch letters in message (basic cryptology)...
I am trying to switch letters around in a message for an application on my site (see here). The prob

getAlexaRank($url) function not working
I have made a function to get alexa rank
the site is here: http://mytestsite.rack111.com/1

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

echo $rows help
Hi all,

Hopefully something simple that I don't know!

I have this:

Code: [Selec

Database connection failure
Hello All,

I am trying to create new connection to Oracle DB 10.1,
I could not see a

Server side $_SESSION
how does one keep the session completely server side. no cookies to the browser at all. i need this

Error querying database.
I get the above error when trying to insert some values to a datatable.
Here's the code :

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