MySQL Forums
Forum List  »  General

Re: MySQL Date/Timezone Conversion/GMT
Posted by: Rick James
Date: February 25, 2015 10:53PM

Suggested alternative...

Next to tue_open, have the tue_open_secs (ditto for the other open/close times), where tue_open_secs is the seconds since midnight Sunday morning, in UTC. That is, plan on doing all arithmetic as if it is UTC; no need for date_sub.

Then further change it by having 7 rows in a table instead of 7 columns in one table. This new table would have weekday_num, open_secs, and close_secs. That way, a single row need be fetched to check the current day's open/close.

You can continue to have a "open" that is human readable.

Options: ReplyQuote


Subject
Written By
Posted
Re: MySQL Date/Timezone Conversion/GMT
February 25, 2015 10:53PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.