Web Projects Outsourcing

Programming for mysql with Native Timezone Support

The idea behind that is that you do not have to take time server time offset when programming for mysql.

Based on //www.electrictoolbox.com/mysql-set-timezone-per-connection/ and  //dev.mysql.com/doc/refman/5.1/en/time-zone-support.html.

Run once and then in cron:

To test:

and check the results you get in the table above.

The above shows to make use of date and time mysql commands bound to native timezone support per connection. And now, in your php code, when opening a mysql connection you can generally use something like:

Very helpful, taken from a real Zend framework-based application.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.