homepage Welcome to WebmasterWorld Guest from 54.234.180.187
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Accredited PayPal World Seller

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library : Charter : Moderators: physics & whoisgregg

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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved