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

Calculating a rating by adding number of points and dividing by number of items
I have a site that users can post links to files to download. They can rate these files on a 1-5 sca

RSS feed - FeedList for WordPress
Hi,

I'm trying to alter the FeedList plugin for WordPress so that I can click on the title of

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

Posting Serialized Data Not Working
I am trying to send an object from one PHP file to another using POST. I serialize the object and th

PHP - MySQL Fail
My PHP code will only execute the first part of my code...

Code: <?php

sessio

Where do I put CRON code
So I've figured out alot about how to automatically run a php function. I can't figure out where to

PHP/PKI
I am trying to set up a web application that uses pki. does anyone have a good tutorial to set this

PHP XML extraction text
I would like to extract an xml text and have that text directly echo(print) out on my web page. Her

str_replace help
I am thinking str_replace is my only option to filter outputs from my database to convert them to sa

Unique Visitor Tracking
Hello. Currently, I run a voting site where voters are tracked by their IP address and can only vote

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