homepage Welcome to WebmasterWorld Guest from 54.163.91.250
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

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




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

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

 

whoisgregg




msg:4136013
 4:57 pm on May 20, 2010 (gmt 0)

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved