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

Strip Slashes Help
I've got a script that i've downloaded of the net to edit multiple fields from my sql database, and

Default TimeZone
The server I'm working with is hosted in America so all times inserted into the database are coming

writing a screen scraper
Hello,

I'm writing a screen scraper application and want to be able to get absolute addresses

Typedef struct vs just struct
Anyone know the rationale for using typedef for structs when a struct is itself a typedef? I have s

XML Grouping
I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, h

Multiple websites question.
Hi, does php have any functionality that enables a programmer to extract information from a website

Xacute search within SQL results
I have a query that is pulling data, and I want to return a specific value from the results of that

why does my session end?
my connect.php starts the session just so you know
i can navigate arround my site fine except whe

filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h

Preg_match question
I want to use preg_match to make sure a string is always 6 characters long and only contains 0-9 and

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