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 = "";
$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

Email/MMS to Site
Hey guys. I'm looking for a way for a user to upload images and/or text via their cell phones. It

Web Host List
Here is a list of web hosts that offer PHP and MySQL. It is no where near a full list, but it is mos

Parse Error with doctype
I'm getting a parse error with this simple code. I don't get it. It worked one time then when I relo

Schedule editor
Hi,

I have a question related to Schedule editor.
If we schedule a BLS for every 30

Include a php
Hello,

I'm trying to include a function that shows the recent searches.
Example I have <

PHP switch function help
Hi, I am trying to create a search function for a directory website. On the search function on html

Shuffle Array
Hi,

I am writing a script for a game that needs players to randomly be assigned a target (ano

MySql timezone
Code: $sql = "SELECT *, date_format(date, '%m/%d/%Y at %I:%i %p' )as date FROM comments WHERE t

noob cURL help
I have a pretty basic form that I need to cURL post to a file in my includes folder (includes/login.

PHP friend keyword equivalent
is there a PHP equivalent for the C++ friend keyword?

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