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

Using Microsoft Exchange Server with PHP
Hi,

I wanted to know if its possible to fetch email attachments from the exchange server usin

CHECH A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect a

To change the name of label on SAP screen XK02.
Hi All,

Can one suggest me how to change the label of an input field of a sap standard s

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

Typedef struct vs just struct
Anyone know the rationale for using typedef for structs when a struct is itself a typedef? I have s

Namespace Problem
I'm having problem with a section of code with a variable namespace.

This code works fine:

restricting another login once you logout
Hello,

how can I restrict a page from login authenticating against info in a MySQL DB for a s

Undefined Variable: PHP_SELF, pls help
Hi,

Im a newbie on PHP / MySQL programming and Im running a script to search one field on my

Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the

Help with translating C code into assembler code
Hi im doing a project that moves a robot around a maze avoiding walls and need some help with conver

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