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

strtotime issue
Hey all,

I'm playing around with some code, and basically the idea is:

Person changes

how to get values from $_Post with onchange="form.submit();"?
Hi, I have a form that submit to itself with a file upload field and two other hidden field values.<

help, header() is not working!
Hello, I have this code:


<?php

/**
* @author samoi
* @copyright 200

Newb advice
Hi all,

I'm a flash front end designer and I've taken on a project that needs some back end p

Problem in back link
I have page where i have given javascript back link but when i click on it browser give a message

Upload, SSL and more php help
I recently just installed a ssl cert and do i use https for the whole site or just for the checkout.

IS Retail & Manufacturing
Hi

Can IS Retail and Manufacturing activities be done in same instance ie. in same client

Changing files over
Just thought I'd start with the new forums looking really nice .

Ok basically I've made this

Frustrated php Newbie
First off, I am pretty much a PHP nub. I can read and understand the language (most of the time) so

$variable $variables type question
I need to be able to designate an array element dynamically, so I thought to use a variable variable

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