Counting down the days....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Counting down the days....

Post by simonmlewis »

Is there a way to say how many days are left up to a certain given date: ie. Christmas.

I know of the method to get today's date.
And I know how to convert it into the PHP format.
And I know how to get it ti convert a given date into the same format.

But how do you say : Given Date - Today's Date = "so many days" ??
that 6-7 digit number.... how do you convert that into actual days?

Easy peasy???
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Counting down the days....

Post by s.dot »

http://us3.php.net/manual/en/datetime.diff.php - calculates differences between two dates
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply