Welcome to WebmasterWorld Guest from 54.162.155.183

Forum Moderators: open

Message Too Old, No Replies

MySQL time zone type?

What is the best type to store time zones in MySQL?

     
9:19 am on May 14, 2010 (gmt 0)

WebmasterWorld Senior Member jab_creations is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Simply put what is the best type to store time zones as?

For clarification an example of what I'm intending to use currently (unless there is something better that I'm currently unaware of): -5:00.

- John
4:57 pm on May 20, 2010 (gmt 0)

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member



To store "-5:00" the only data type you could use is VARCHAR.

However, if you ever wanted to sort by that column, you'd probably want to convert those offsets into something like "-5.00" in which case you'd want to use FLOAT(4,2).

If it weren't for the rare half hour offsets, you could just use TINYINT SIGNED.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month