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

Dynamic memory problem
Hey,

At the beginning of my code, I have this line:

Shape* gShape = 0;

Help with ORDER BY
Hello. I would like to order by ascending States, then Cities, then Gyms in the following code, but

array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I h

Help with file_get_html
The following code gives the expected results:

<html>
<head&g

PHP form authentication
Hi guys,

what am trying to achieve is this: Whenever a user tries to login to my website, an

MSSQL/PHP
I am tryint to setup a webapplication developed in PHP, Apache2.0 and SQLServer2000 as backend which

if php cookie set, show code...
Hi all.. I need to figure out this little snippet right quick.. seems like it should be easy enough

PDO returns erroneous columns from within pdt
Hi All,

This is a truly weird behavior:
When using a simple pdo fetch, erroneous columns a

mails going in spam??
The mails I sent to folks in my database using mail(function) are going in spam??

Any idea ho

Small problem with image resize script
Hi!

I am a little bit new to php and I have an issue installing an image resize script I down

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