storing timezone information in mysql database
This question already has an answer here:
VARCHAR(6)
is fine, but personally, i would store the offset using a signed SMALLINT
(in minutes).
Like this, you can store numbers from -32768
to 32767
.
You could also store it as TINYINT
if you just want to store the hours-offset. (from -128
to 127
)
its all depends upon on you, but Varchar
works for you.
decimal(2,2)
also works fine for storing time zone. For other Date related data types are as follows
Data Type
1- time
2- timestamp
3- date
4- datetime
上一篇: 夏令时问题
下一篇: 在mysql数据库中存储时区信息