|
Posted by gosha bine on 08/15/07 10:23
On 15.08.2007 11:57 FFMG wrote:
> Hi,
>
> Given a time I want to know if it is today or yesterday, (on the
> server).
>
> I cannot use time difference because if I log the time and it is 23:59
> and I check again at 24:01 then the earlier time is, in fact,
> yesterday.
>
> so given time $a and time $b how can I calculate if $a is the day
> before $b?
>
if(unixtojd($b) - unixtojd($a) == 1)
http://www.php.net/manual/en/function.unixtojd.php
if the dates are in Mysql you'd be better off with TO_DAYS()
--
gosha bine
makrell ~ http://www.tagarga.com/blok/makrell
php done right ;) http://code.google.com/p/pihipi
Navigation:
[Reply to this message]
|