Previously, the time fields of the data table in the project used int (10). When reading this morning, I suggested using the TIMESTAMP type. How do you store the data in the project? The time fields of the data table in the project used
Int (10)
When reading this morning, the book says it is recommended to use
TIMESTAMP
Type. How do you store data in projects?
Reply content:
The time fields of the data table in the project usedInt (10)
When reading this morning, the book says it is recommended to useTIMESTAMP
Type. How do you store data in projects?
Datetime and int should be less accurate than milliseconds, and timestamp and bigint can
Int occupies 4 bytes, and the 4 bytes are 32-bit. If it is not 32-bit before it is set to 0, the unsigned int (10) in MySQL) the maximum integer that can be stored is 2 ^ 32-1, that is 4294967295.Echo date ('Y-m-d H: I: s', 4294967295 );
2106-02-07 14:28:15 is returned, that is, the timestamp after the time cannot be stored in the int (10) field. I personally think that 8-byte bigint can be used to ensure that the time stamp of the earth is stored.
We useDatetime
The disadvantage is that there is no millisecond and the memory type needs to be recorded in milliseconds.
I personally prefer int-type Timestamp... For details, please come to my friends downstairs...