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 gosha bine on 08/15/07 10:41

On 15.08.2007 12:26 Rik wrote:
> On Wed, 15 Aug 2007 12:23:52 +0200, gosha bine <stereofrog@gmail.com>
> wrote:
>
>> 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
>
>
> Erm, Julian days start at noon?

Don't trust every comment you see in the manual. ;)



--
gosha bine

makrell ~ http://www.tagarga.com/blok/makrell
php done right ;) http://code.google.com/p/pihipi

 

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

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