You are here: Re: Time occurs between two time « PHP Programming Language « IT news, forums, messages
Re: Time occurs between two time

Posted by ELINTPimp on 08/03/07 14:54

> > 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.
>

yup, currently doing it in a small project I'm working on.

your function:

function checkTime($time1,$time2){
$nowTime=date("H:i:s");
//do validation on $time1 and $time2 to ensure H:i:s format

if( $time1>$nowTime && $time2<$nowTime) {
return true;
}
else {
return false;
}
} // end checkTime


your function, which stripped of validation and exception handling,
looks like it should work (so long as $time1 and $time2 are in H:i:s
format. What's the problem?

 

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

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