By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,745 Members | 1,889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,745 IT Pros & Developers. It's quick & easy.

Meeting Schedulars

100+
P: 245
Hi,
i am a new bee here and hope to have some replies from your end. I am working on a project that has to assign the time slaps for meeting any particular member.the logic behind it is that the members will have to give a starting time and ending time and the duration for the meeting , means if i am a working in a office and someone has to arrange a meeting with me lets say i have the starting and ending time from 9:00am to 3:00pm and the duration of each meeting is 30 minutes then i have to show an equal time intervals in this case it would be
9:00am ~9:30am
9:30am~10:00am
10:00am~10:30am
10:30am~11:00am
11:00am~11:30am
and up to 3:pm respectively
can any one have any idea about how should i be calculating the time intervals for example if i have start time 9:00, end time 12:00 and time interval say suppose if i entered 30 then it will make time slabs for me like

9:00am ~9:30am
9:30am~10:00am
10:00am~10:30am
10:30am~11:00am
11:00am~11:30am
11:30am~12:00am

Best regards,
Mohsin Rafique
Aug 21 '08 #1
Share this Question
Share on Google+
3 Replies


nathj
Expert 100+
P: 938
Hi,

You are going to need a loop from the start time to the end time and increment variable. Inside the loop you set another variable to give you the time slot you require.

You'll need to look at the date and time functions in php to get this sorted properly.

Expand|Select|Wrap|Line Numbers
  1. // Psuedo code
  2. $ltStart = 9
  3. $ltEnd = 12
  4. $lnIncrement = 0.5
  5. for($ltStart=9; $ltStart<=$ltEnd; $ltStart + $lnIncrement)
  6. {
  7. $lcTimeSlot =$ltStart . '-' . $ltStart + $lnIncrement ;
  8. echo $lcTimeSlot . '<br />'
  9. }
  10.  
This is just a code sketch, but I think it's heading in the right direction.
Cheers
nathj
Aug 21 '08 #2

100+
P: 245
Hello,
Thank you very much for resolving my problem. If i will have any further problem regarding to this then i am sure you will not hesitate to solve my problems. Thanks a lot again

Best regards,
Mohsin Rafique

Hi,

You are going to need a loop from the start time to the end time and increment variable. Inside the loop you set another variable to give you the time slot you require.

You'll need to look at the date and time functions in php to get this sorted properly.

[PHP]
// Psuedo code
$ltStart = 9
$ltEnd = 12
$lnIncrement = 0.5
for($ltStart=9; $ltStart<=$ltEnd; $ltStart + $lnIncrement)
{
$lcTimeSlot =$ltStart . '-' . $ltStart + $lnIncrement ;
echo $lcTimeSlot . '<br />'
}
[/PHP]
This is just a code sketch, but I think it's heading in the right direction.
Cheers
nathj
Aug 22 '08 #3

nathj
Expert 100+
P: 938
Hello,
Thank you very much for resolving my problem. If i will have any further problem regarding to this then i am sure you will not hesitate to solve my problems. Thanks a lot again

Best regards,
Mohsin Rafique
I'm happy to have helped out. If you get stuck simply post back and either myself or another member will be sure to help out.

Cheers
nathj
Aug 22 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.