<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>time-zone on seth-shi</title><link>https://sethix.com/tags/time-zone/</link><description>Recent content in time-zone on seth-shi</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 09 Dec 2020 17:30:25 +0800</lastBuildDate><atom:link href="https://sethix.com/tags/time-zone/index.xml" rel="self" type="application/rss+xml"/><item><title>Why Timestamp in MySQL Handles Time Zones Automatically</title><link>https://sethix.com/posts/2020120917/</link><pubDate>Wed, 09 Dec 2020 17:30:25 +0800</pubDate><guid>https://sethix.com/posts/2020120917/</guid><description>I&amp;rsquo;ve long been curious why MySQL&amp;rsquo;s timestamp type can effortlessly handle time zone issues. In practical use with Laravel frameworks, Migration files default to timestamp fields without requiring special attention.
Getting Started Check current database time zone settings mysql&amp;gt; show variables like &amp;#34;%time_zone%&amp;#34;; +------------------+--------+ | Variable_name | Value | +------------------+--------+ | system_time_zone | CST | | time_zone | +08:00 | +------------------+--------+ 2 rows in set (0.30 sec) View table structure mysql&amp;gt; desc timestamp_test; +--------------+-----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+-----------+------+-----+---------+----------------+ | id | int | NO | PRI | NULL | auto_increment | | created_time | datetime | YES | | NULL | | | created_at | timestamp | YES | | NULL | | +--------------+-----------+------+-----+---------+----------------+ 3 rows in set (0.</description></item></channel></rss>