Mysql those things (5) operation time I. Time Command: SELECT CURDATE (); function: return today's date value in 'yyyy-MM-DD 'format. Command: select curtime (); function: return time in 'hh: MM: ss' format. Command: select now (); function: return time in 'yyyy-MM-DD HH: MM: ss' format. II. The automatic record time of the www.2cto.com TIMESTAMP column type can automatically mark the insert update operation time. Example: create table student (id INT, english TINYINT, math TINYINT, chinese TINYINT, time TIMESTAMP); INSERT data: insert into student (id, english, math, chinese) VALUES (,); query data: SELECT * FROM student; Result: student id | english | math | chinese | time | minute 1 | 12 | 23 | 45 | 10:34:09 ------------------------------------------------------------------------- The time column automatically adds the data INSERT time. UPDATE also affects the time value of the time column of the data. The storage requirement of TIMESTAMP is 4 bytes; that of DATETIME is 8 bytes. Www.2cto.com 3. Comparison time select TO_DAYS (date); returns a date, and returns the number of days from 0 years (until date ). Example: SELECT TO_DAYS (NOW ()-TO_DAYS ('1970-10-19 '): return 1 day. SELECT TO_DAYS (NOW (); returns the 735161 day. That is, the number of days from now until 0 years.