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 Rik on 08/15/07 19:08

On Wed, 15 Aug 2007 20:45:33 +0200, Toby A Inkster =

<usenet200707@tobyinkster.co.uk> wrote:

> Rik wrote:
>
>> function is_today($timestamp){
>> return date('d',$timestamp) =3D=3D date('d');
>> }
>
> The following will return TRUE:
>
> is_today(strtotime('15 Feb 1986'));
>
> Better would be:
>
> function is_today ($ts)
> { return date('Ymd',$ts)=3D=3Ddate('Ymd'); }

Up it does. Kept it as simple as possible as the op stated it could only=
=

be today or yesterday: hence not a month difference etc.

Then again this will be up for it when the difference _can_ run longer =

indeed.

-- =

Rik Wasmus

 

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

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