Re: Need help about date in php

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

 



In message <24247.72381.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>, agus susilo
<deffleo@xxxxxxxxx> writes
>hi expert!.
>
>i need help to calculate a date, how much the remain of day?, 
>i try subtract(-) between $expire_date and date now. so, i subtract a year 
>first,
>and then month, at last a day. 

There is an example in the manual, 
http://es.php.net/manual/en/function.mktime.php

function daysBetween($date1, $date2)

Assuming that one of your dates is always now, you could shorten this
function.  And I assume that the 6 lines in the function similar to
$year1 = $d1[0]; are only there to simplify viewing the code, as they
aren't necessary.


-- 
Pete Clark

Sunny Andalucia
http://hotcosta.com/Andalucia.Spain

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux