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

Help with Password Encoding/Decoding?
Trying to design a "change password" tool. On my signup code I'm using base64_encode, now

Problem with an browser game.
Hello,i just joined that great forum and i got php prob,its kinda freaky...anyway i got browser game

Can you help please? Php file
I have to write this php file to allow users to register their nicknames on nickserv

For an I

Putting double spaces instead of single spaces
Im looking at trying to replace all single spacing between fields with double spacing

At pres

'grab_files', multiple extension?
hey guys,

can anyone suggest a way to make to following line of code look for files with more

am I using this for loop correctly
Dear buddies!

Right now I am generating a report with some details for all the dealers.

what business processes?
Hi,

A general question. What business processes (like OTC - Order to Cach, P2P, R2R etc)

how can i display php source code snippets ?
I am outputting some pho code .. and I want to display the source code so people can copy and paste

PHP doesn't send my mail
Hi all, I found this and used it to send mail. Simple contact form with some required fields. The va

Curly Bracket Delimeters.
I'd always believed that the starting and ending delimeters in preg_ functions had to be the same ch

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