Using MySQL's TIMESTAMP vs storing timestamps directly

前端 未结 3 417
情深已故
情深已故 2020-11-30 22:18

I\'m in a dilemma about saving date and time values in MySQL\'s TIMESTAMP format vs in a custom UNSIGNED INT format. The main considerations here are speed of retrieval, app

3条回答
  •  旧时难觅i
    2020-11-30 22:59

    This might not be a "scientific" answer but I always find the way MySql handles conversion, arithmetics, comparsion, etc... on TIMESTAMP columns confusing. An UNSIGNED INT column is much more straight forward and I always know what to expect.

    P.S. Perhaps one other thing in favor of TIMESTAMP column is its ability to be automatically set to current time after each update or insert but that is not something you can't live without.

提交回复
热议问题