Re: difference between two dates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 19, 2003 at 09:34:02AM -0500, John W. Holmes wrote:

>> I tried this :
>> 
>> $dobtimestamp = mktime(0,0,0,$cboMM,$cboDD,$cboYY);
>> $todaytimestamp = time();
>> $txtAge = ($todaytimestamp - $dobtimestamp)/86400;
>> 
>> It does not give me the expected output.
>> 
>> Can anybody suggest something ?
>
>Keep your mktime() as it is, that's correct. Then use something like
>this to calculate the age:
>
>$age = date('Y',$now) - date('Y',$dob) -
>((date('z',$now)>=date('z',$dob)) ? 0 : 1);
>
>where $dob and $now are the appropriate unix timestamps that you've
>already got calculated with mktime() and time().

Thanks a lot. 

Peace

--
Rajesh
:
####[ GNU/Linux One Stanza Tip (LOST) ]#######################

Sub : ext3 file system                               LOST #034

To implement ext3 filesystem have a good look here (Cool) :
http://www.uow.edu.au/~andrewm/linux/ext3/ext3-usage.html

####<rfowkar@yahoo.com>#######################################
:

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux