Jump to content

Unix Time Difference


alan89

Recommended Posts

Hi,

 

I have a system where users can book appointments slots to speak to an online support member.

 

The different departments have different slot lengths, eg:

Phone Support - 30 minutes

Remote Desktop - 1.5 hours

 

So an example of the slot timetable would be:

Phone Support:

9:00

9:30

10:00

10:30

11:00

11:30

12:00

 

Remote Desktop:

9:00

10:30

12:00

13:30

 

The support team members cater for all departments. This means they do not have a pre-set schedule. Therefore the system needs to be able to determine whether or not the support member is free.

 

So for example:

 

Support User A:

9:00 - Remote Desktop

10:30 - Phone Support

11:00 - Phone Support

 

Support User B:

9:00 - Phone Support

9:30 - Phone Support

10:00 - Phone Support

13:30 - Remote Desktop

 

So a user comes a long and wants remote desktop support at 10:30. So the system would check with support user A to see if the slot is free.

 

In the example above the slot is not free due to the phone support at 10:30.

 

So the system should move onto support user B. The example shows that from 10:30 - 13:30 the support user is free so the system should assign the user to support member B.

 

The support times are stored in unix.

 

In a nutshell..

What would be the best way to determine whether a support member has a free space or not?

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/125362-unix-time-difference/
Share on other sites

just keep a table with the timeslots (date and time) and if the entry doesn't exist (eg. 9/29/08 at 10:30 for person A doesn't exist) then assign the user to this support slot, if it's taken, move on to the entries for support personnel person B and see if that person is free at that same time... etc.

Link to comment
https://forums.phpfreaks.com/topic/125362-unix-time-difference/#findComment-648088
Share on other sites

You can also use BETWEEN combined with datetime type columns... Say the user wanted a remote session at 10... you could check for rows between 10 and 1130, to make sure the tech doesn't have another appt. at 11 or something.

 

I think this is probably my best option. I store the beginning unix timestamp and the duration of each session in a table. A row is only inserted when a session has been booked.

Link to comment
https://forums.phpfreaks.com/topic/125362-unix-time-difference/#findComment-650401
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.