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

Storing Values taken from a DB...
Using this code it will generate a short list from my database

<?php
mysql_connect

php form help
Hey,

I use a control file to set my meta tags and titles

Here's an example
Code: &a

Seperate team from score
I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the sc

Upload file and add HTML
Hey everyone,

I have a client has meeting agendas and minutes that should be posted online. I

temporary objects
Until now i thought every temporary object in C++ is created as constant. I'm wondering why my compi

Update data to upper case in parent/child tables
Hi Gurus!

In production we have a product table and which is being reference by many tabl

re calling a function without including file
Hi,
i am new to programming in php, i was just checking the wordpress code and found out in the w

How to submit a form to the same page?
I have a table containing information about books in my library and this table has the following col

how to load a Sys file with system load and call images?
normally you need register the module as a service with CreateService, and start the service

PHP Thumbnail Creation
Ok so i use this function to create thumbnails:

Code: [Select]function createthumb($name,$fil

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