Showing a Column as a UNIX Timestamp in MySQL
Sunday, October 5th, 2008I often need to store a timestamp in the UVFood database. There are lots of things I need timestamps for - recording the time that a user account was made or a modification was made, for instance.
While MySQL has quite an assortment of date and time formats which it supports, I usually find it most convenient to store timestamps as an INT and just put the UNIX seconds since the epoch value in there. I don’t need to do funky searches on the timestamps, I just need to do simple comparisons.
Feed