Posted by Jerry Stuckle on 08/03/07 11:37
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.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|