Should I use a big INT or regular INT in MySQL to store a timestamp?

JasonDavis picture JasonDavis · Jan 8, 2010 · Viewed 15.8k times · Source

Should I be using a big integer or a regular integer in MySQL to store a timerstamp in? I plan on storing it in an INT and not the built in timestamp or datetime so which INT type should I use?

Answer

zmbush picture zmbush · Jan 8, 2010

Int would roll over to a negative in 2038 (if you are using UNIX timestamp): http://en.wikipedia.org/wiki/2038_problem.

so BIGINT is probably the safest choice