Skip to forum content
Code The World
We are a group of graphic designers and web developers trying to create a social network for the people, and not for the commercialization of said social network.
You are not logged in. Please login or register.
Pages 1
You must login or register to post a reply
- Registered: 2007-11-19
- Posts: 12
Topic: Number of days between now and a day in the future
Description
This will calculate and show how many days there are from the current date to a date in the future that you define.
The code
<?php
// Change this to the day in the future
$day = 10;
// Change this to the month in the future
$month = 12;
// Change this to the year in the future
$year = 2003;
// You do not need to edit below this line
// $days is the number of days between now and the date in the future
$days = (int)((mktime (0,0,0,$month,$day,$year) - time(void))/86400);
echo "There are $days days until $day/$month/$year";
?>
- Porkey
- New member
- Offline
- Registered: 2008-06-15
- Posts: 1
Re: Number of days between now and a day in the future
Thanks a ton, I couldn't find any good examples anywhere else. Thanks.
Re: Number of days between now and a day in the future
thanks, this will come in handy no doubt
Posts: 3
Pages 1
You must login or register to post a reply
Powered by PunBB, supported by Informer Technologies, Inc.
Currently used extensions: pun_admin_manage_extensions_improved, pun_poll, pun_quote, pun_bbcode, pun_repository, pun_tags, pun_admin_add_user, google_analytics, pun_eggdrop, pun_recaptcha.
Copyright © 2007 - 2025 CodeTheWorld