Storing Business Hours in a Database

后端 未结 6 667
迷失自我
迷失自我 2020-12-04 07:05

I\'m currently trying to work out the best way to store a business\' hours of operation in a database.

For example:

Business A has the following hours of ope

6条回答
  •  借酒劲吻你
    2020-12-04 07:38

    One situation that isn't covered by this schema is several opening periods in a day. For example, the local pub is open 12:00-14:30 and 17:00-23:00.

    Maybe a theatre box office is open for a matinee and an evening performance.

    At that point you need to decide if you can have several entries for the same day, or if you need to represent different hours in the same row.

    What about opening times that cross midnight. Say a bar is open 19:00-02:00. You couldn't just compare the opening and closing times with the time you want to test.

提交回复
热议问题