Which one is best to use, DateTime or INT (Unix timestamp) or something else to keep the time value?
I think INT will be better in performance as well as more versatile, as it can easily be converted to many time zones. (my visitors from around the world can see the time without confusion)
But I still doubt it. Any suggestions?
I would not use INTor TIMESTAMPto save your datetime values. There is a "Year-2038-Problem" ! You can use DATETIMEand save your dates for a long time.
INT
TIMESTAMP
DATETIME
With TIMESTAMPor numeric column types, you can only store years from 1970 to 2038. With a type, DATETIMEyou can store dates with years from 1000 to 9999.
It is not recommended to use a numeric column type ( INT) to store time and time information. MySQL (and other sytems too) provides many functions for processing time and time information. These functions are faster and more optimized than user-defined functions or calculations: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html
, CONVERT_TZ. . , .
CONVERT_TZ
TIMESTAMP , . , TIMESTAMP .
, , :
CONVERT_TZ(@dt,'US/Central','Europe/Berlin') AS Berlin,
int, MySQL Cookbook Paul DuBois, . quetion.
Source: https://habr.com/ru/post/1676020/More articles:How to call the copy constructor of all base classes to copy most class class objects to diamond inheritance in C ++? - c ++After importing a custom form into VBComponents properties, you cannot read it - vbaAdd multiple WebGrids with styles on one page without redundancy - htmlantMatchers that match any beginning of the path - springQ_PROPERTY NOTIFY signal and its argument - c ++Для сигнала NOTIFY на свойстве какая разница, если я даю ему параметр? - c++Calibrate hex and rgba colors using regex in php - phpHow can I get the nvcc CUDA compiler to optimize more? - cudafailed to infer template argument for T * from FieldType * (Visual C ++ only) - visual-c ++laravel: Page login form without Laravel - javascriptAll Articles