开发者

Mapping timeslot to timestamp

开发者 https://www.devze.com 2023-03-24 07:31 出处:网络
I have a table of 336 rows. Each row assemb开发者_如何学JAVAles 30 minutes during the day throughout the week. In other words: 24 x 2 x 7

I have a table of 336 rows. Each row assemb开发者_如何学JAVAles 30 minutes during the day throughout the week. In other words: 24 x 2 x 7

Timestamp: UNIX format

timeslot: (dunno yet)

My aim is to find the best way to name timeslots inside the table so I can map any timestamp to its row (timeslot) inside table.

I came to the idea of naming it dhhmm for Example 10830 means Sunday 8:30 am

But now I have issues when fetching the data using mysql. Can anyone suggest any better name convention?


Why not name the slots for human directness and simplicity? Sun 00:00:00-29, Sun 00:00:30-59, ..., Sat 23:59:30-59

But don't use the name for selecting a slot, use the slot identifier, perhaps a simple integer sequence 0 .. 24*2*7-1.

0

精彩评论

暂无评论...
验证码 换一张
取 消