On 2016-05-10 1:23 AM, Jaime Crespo wrote:
On Mon, May 9, 2016 at 6:15 PM, Brion Vibber bvibber@wikimedia.org wrote:
In 2001 when Magnus was writing the initial attempt at a custom wiki engine in PHP backed by MySQL, he chose to use the TIMESTAMP column type.
TIMESTAMPs in MySQL 3 were automatically filled out by the server at INSERT time, normalized to UTC, and exposed in the 14-digit YYYYMMDDHHMMSS format we still know and love today.
By the way, if we had to design this from the scratch, TIMESTAMPs now allow to not be auto set https://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html This would save 15 - 4 = 11 bytes per row. However, both in code and migration effort + potential bugs + backwards compatibility, this is not worth it.
Plus TIMESTAMP suffers from the year 2038 problem. https://en.wikipedia.org/wiki/Year_2038_problem
DATETIME only needs to worry about the Y10K problem. https://en.wikipedia.org/wiki/Year_10,000_problem
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]