How to store a store opening hours in an SQL database?
问题 I am developing an app for stores (in fact, restaurants) and need to design the PostgreSQL data structure for it. For instance, the restaurant might have opening hours Mon-Fri from 7:30 to 17:00 and from 20:30 to 1:00 the following day. The data to be stored for each weekday would be something like ['Monday', true, 450, 1050, 1230, 1500 ] , being true === "it does open on Mondays", 450, opening time is 450 minutes past midnight (see here), i.e. at 7:30h, closes at 17:30h, reopens at 20:30h,