Reply to Re: How can I tell if a time was yesterday?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация