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

string to currency format
Hi guys...

Actually I chunk out some data from txtfile and one of the data contains amount va

unexpected T_VARIABLE error
Hey all! I'm getting an unexpected T_VARIABLE with the following function:

function getHighes

weird problem
last time, i did post a topic concerning why my page sometime will load as blank page when using IE.

Do something every fifth time?
I'm trying to write a loop, but I want it to do something different after every fifth instance. Like

A WBS element with the name XXX already exists in version FREI_VERSION
Hi.
When I am trying to insert WBS element in a project, error occurs:

"A WBS eleme

Open link with largest int string first
I have the following links i would like to open either all at once or one-by-one. How would i procee

What's wrong with my code
sobbing for many days, still don't know why please Help. Why my page isn't posted correctly. In a

square instead of number
Hello
I do not know why but this code seems to work fine only in my xampp local insallation but n

Nested (echoed) php running wrong script
Got a problem with a php website I'm creating.

In a nutshell, the first page is entirely html

PHP Display Telephone Number On Referrer
I have used the php below to show a different telephone number in the header of the site depending u

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