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

insert/update functions for mysql, what do you think?
I am working on two really simple functions that automatically generate (and execute) insert and upd

PEAR Email Attachment w/ $gpg
I have no issues with this code if I take out the attachement section and include the info in the em

phpMailer will not connect using SMTP
I am trying to use phpMailer with smtp:

Code: [Select]$mailer = new PHPMailer();
$mailer-&

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

Parse String
I need to parse the string below into three variables. How would I do that?

john + 10/20/2008

Extending Exception to contain method name
I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a

PHP page is blank
Hi Everyone,

I have a site in which I am able to open the first PHP webpage in my browser but

Suggestions for Functional module
Hello experts,
I Have done B.Sc(Mathematics) and MCA & have learnt SAP/ABAP but do n

Not adding to db
Hi, I can't figure out why it won't add the record to the database. It's just a simple form to get

Apple's revamped lineup arrives

I'm personally curious about the magic mouse.. a multi-touch concept sounds like it could be nea

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