Forum Moderators: coopster

Message Too Old, No Replies

check time conflict

         

jimmyme

7:35 am on Apr 21, 2008 (gmt 0)

10+ Year Member



Hi.. please help.

i googled about this and can't find a script.

is there a php function that checks a time if it conflicted with other time?

like how would I know if 3PM-4PM is inside 1PM-4PM?

Is there a function for this?

Thanks.

phparion

8:06 am on Apr 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld

I am not quite sure about your question, however to subtract / find time differences between two intervals you can always use strtotime() [php.net] and mktime() [php.net] functions. Do read the user comments for each function. you will find ready made solutions / functions for your requirements.

coopster

6:03 pm on Apr 22, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



In PHP you would have to compare the start time and end time or duration of the first time period with the same values of the second time period. On the other hand, if you are running a database server that supports standard SQL, there is an OVERLAPS predicate that you could use to run a quick query to verify true or false.