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

Small problem with image resize script
Hi!

I am a little bit new to php and I have an issue installing an image resize script I down

Simple MySQL script is not working
Hey guys,

Just familiarizing myself with PHP and MySQL. I am following along in the O'Reilly

db entry based on primary key
My "topics" table contains 10 entires
*--------------*
topicid topic
------

Help with PHP Email Script
Hi guys,

I'm a newbie to php and need help with the script below:

At the moment when I

Database/Table Collation
What is the Database, and table collations used for? i don't understand what there used for since co

How do I create a 2D game "camera" to follow player?
In J2ME programming I'm targeting MIDP 2.0 devices.

I'm using gamecanvas and I was thinking t

array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e

Applet JTextField Size Problem
Hello,

I recently started making an applet to calculate certain values for airplanes. However

Shuffle Array
Hi,

I am writing a script for a game that needs players to randomly be assigned a target (ano

Record count of entire database
Does anyone know if there is a way to obtain the number of records in each table of the database usi

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