You are here: Re: How can I tell if a time was yesterday? « PHP Programming Language « IT news, forums, messages
Re: How can I tell if a time was yesterday?

Posted by FFMG on 08/15/07 11:24

Rik;87140 Wrote:
> On Wed, 15 Aug 2007 11:57:38 +0200, FFMG
> <FFMG.2vcq3z@no-mx.httppoint.com>
> 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) == date('d');
> }
> --
> Rik Wasmus

Sorry you are right, I was trying to illustrate my point.

I am using unix timestamp.

FFMG


--

'webmaster forum' (http://www.httppoint.com) | 'Free Blogs'
(http://www.journalhome.com/) | 'webmaster Directory'
(http://www.webhostshunter.com/)
'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php) | 'Free URL
redirection service' (http://urlkick.com/)
------------------------------------------------------------------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=19402

Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

 

Navigation:

[Reply to this 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

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