Khuram Noman wrote:
Hi

Is there any function avialable in PHP to calculate
the no of days by passing 2 dates like 1 argument is
1/1/2005 and the second one is 1/2/2005 then it
returns the no of days or how can i do that if there
is no builtin function .

Regards
Khuram Noman

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

Here's a piece of code that I use on my website. It calculates the number of days from today to some future date (which happens to be July 16, 2005) It's not exactly what you asked for but it might be helpful to you. No one will confuse me with being a professional programmer but this seems to work well on my site.


<snippet ----
$timeuntilcamp = mktime(12,0,0,7,16,2005,-1) - time();
$daysuntilcamp = round($timeuntilcamp/86400);
if ($daysuntilcamp > 0)
  {
  print "<h4>Days until start of 2005 Camp: ".$daysuntilcamp."</h4>\n";
  }
---- snippet>

You can see it in "action" by visiting:

http://www.salkehatchiehuntersville.com/Salkehatchie_2005_Camp.php

--
Jerry Kita

http://www.salkehatchiehuntersville.com

email: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to