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

Contact Form Not Working When I Add Validation Codes
So I built my first working PHP "Contact Us" like form. But, I have been trying to now mak

Tree Menu
Hi guys,

Can anyone help me making a tree navigation system? I have a site where I'm allowin

Need help to modify php ELSE code
I'm trying to find a way to have the php code display a message if there is no inventory listed in t

Performance impact of cookies
Hi, I was just wondering what impact there would be in terms of performance if you where to set then

Save cookie to DB
I'm working on a pixel tracking script for an incentive website and I need to use an ASP script to s

Print out contents of to Excel
I have got this script that gathers all the data that I need but I need it to send it to excel inste

preg_replace question
Hello!!

I hope someone can help me with preg_replace.

I load two tables from an extern

Error in query: Resource id #4??
hey guys, having a minor (i think) problem here that i havent been able to figure out. long story sh

Please help understand this code
I noticed the index page on my site was modified this morning and found this code inserted at the bo

Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing,

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