开发者

datatype for storing timezones

I want to store timezones but not in the开发者_StackOverflow中文版 timezoneoffset datatype. Should I use a decimal or a float? Or something else? Timezones can be GMT -3.5 for NewFoundland or +5.5 for parts of India so int wouldn't work.


Why not use a lookup table? It would look like this:

create table TimeZone (
    id int identity primary key,
    name varchar(50),
    offset decimal(2,1)
)

With a foreign key reference from your main table.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜