Reply to Re: Time occurs between two time

Your name:

Reply:


Posted by gosha bine on 08/03/07 14:44

On 03.08.2007 13:37 Jerry Stuckle wrote:
> Kesavan wrote:
>> I need a function such it returns true when current time occurs
>> between the parameters.
>>
>> function checkTime($time1,$time2){
>> $nowTime=date("H:i:s");
>>
>> //MY LOGIC IS
>>
>> if( $time1>$nowTime && $time2<$nowTime)
>>
>> ///
>>
>> return true;
>> else
>> return false;
>>
>> }
>>
>> plz guide me the function run.
>>
>
> You can't compare times as strings and expect it to work. You need to
> first convert them to a numeric value, i.e. unixtime format.
>

Times in H:i:s format can be perfectly compared as strings.


--
gosha bine

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

[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

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