|
Posted by Rik on 08/15/07 10:18
On Wed, 15 Aug 2007 11:57:38 +0200, FFMG <FFMG.2vcq3z@no-mx.httppoint.co=
m> =
wrote:
> 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?
What format is your time in? 24:01 is highly unusual to use. If you got =
=
real timestamps, you can create & compare any timestamp using one of the=
=
date formatting functions.
function is_today($timestamp){
return date('d',$timestamp) =3D=3D date('d');
}
-- =
Rik Wasmus
[Back to original message]
|