Ask Your Question
4

What is the starting and ending time in SQL for users who work overnight shifts or stay logged in after midnight?

asked 2021-12-04 11:00:00 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-07-09 02:00:00 +0000

djk gravatar image

The starting and ending time in SQL for users who work overnight shifts or stay logged in after midnight depends on the specific definition of their working hours.

One approach could be to use a 24-hour clock and assign midnight as the start time for the day. In this case, a user working an overnight shift from 10:00 PM to 6:00 AM would have a starting time of 22:00 and an ending time of 6:00.

Another approach could be to use a more flexible time range and allow for overlapping days. For example, a user who logs in at 11:00 PM and stays logged in until 2:00 AM the following day could have a starting time of 23:00 and an ending time of 2:00.

Ultimately, the specific approach will depend on the needs of the system and the way in which users' working hours are defined.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-12-04 11:00:00 +0000

Seen: 8 times

Last updated: Jul 09 '21