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

Problem with the Update command used with a sqldataadapter
I'm connected to a database on an SQL Server and I'm using a sqldataadapter, sqlconnection, sqldatas

gmmktime or mktime
I live in the UK, i am within the GMT (with daylight saving time ie 1 hour difrence between summer a

Class not found error
I am getting Class 'index' not found in Eval function:

//write config

$pat

Simple Question
I know this is a simple question, that if I knew what it was technically called i could probably loo

cookie problem
I hv a website url
In this site main menu functionality based on cookie when user click on parti

Do not allow posting of whitespace
Currently the script below works if the user does not type a name/message, but if i create a whitesp

How a counter of users ? such as ---> (231 Viewing)
I want to count how many users are actually viewing the page, How is that possible?
Thank you guy

INSERT for date range
Hi all

I have the following table

Code: [Select] `date` date
`day` int(2)
`

PHP and SMS
Hi all forum members. I am new here and am unsure what category shoild I post this in.
Moderator

form variables from database help.
Hi all,

I would like to have a form that gives you options based on the results of an mysql q

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