简体   繁体   中英

What MySQL field type is suited for '%H:%i' (ex. '01:23' and '23:45')?

I have a table containing 1440 rows, one for every minute in a day.

What is the best field type?

00:00
00:01
...
23:58
23:59

您可以使用Time数据类型存储值,但是如果要尝试存储一段时间,那么我相信最好将其存储为INT ,然后也可以对其进行一些计算。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM