Difference between SYSDATE () And NOW () in MySQL five functions in MySQL need to calculate the value of the current time: NOW. return time. Format: 2012-09-23 06: 48: 28 CURDATE. Date of the returned time. Format: 2012-09-23CURTIME. Format: 06: 48: 28UNIX_TIMESTAMP, returns an integer timestamp of time, for example, 1348408108 SYSDATE. The return time is in the same format as the return time of the time () function, but there is a difference. In addition to the differences returned by definitions, the first four functions return the statement-based start execution time, while SYSDATE returns the value of time. Through comparison, we can find the differences between the two functions: www.2cto.com NOW () execute the following: [SQL] mysql> select now (), sleep (2), now (); + --------------------- + ---------- + --------------------- + | now () | sleep (2) | now () | + rows + ---------- + ------------------- + | 06:54:29 | 0 | 06:54:29 | + rows + ---------- + ----------------------- + 1 row in set (2.00 sec) The two returned values are the same, it indicates the start time of the statement. Run the following command on www.2cto.com SYSDATE: [SQL] mysql> select sysdate (), sleep (2), sysdate (); + ----------------------- + ---------- + ------------------- + | sysdate () | sleep) | sysdate () | + --------------------- + ---------- + ------------------- + | 06:55:00 | 0 | 06:55:02 | + ----------------------- + ---------- + rows + 1 row in set (2.01 sec) because of this difference, we usually use NOW () when executing the statement, because SYSDATE is obtained Real-time at that time, which may lead to different execution return values of the master database and slave database, resulting in inconsistent Master/Slave Data. Other functions on www.2cto.com are executed as follows: [SQL] mysql> select now (), sysdate (), curdate (), curtime (), unix_timestamp () \ G; * *************************** 1. row ************************** now (): 07:00:05 sysdate (): 07:00:05 curdate (): 2012-09-23 curtime (): 07:00:05 unix_timestamp (): 1348408805 1 row in set (0.00 sec)