MySQL has five functions that need to calculate the current time value: NOW. return time. The format is 2012-09-2306: 48: 28 CURDATE. The date of the returned time. The format is 2012-09.
MySQL has five functions that need to calculate the current time value: NOW. Return time, format: 06:48:28 CURDATE, return time date, format: 2012-09
MySQL has five functions that need to calculate the value of the current time:
NOW. Return time, format: 06:48:28
CURDATE: The date of the returned time. format:
CURTIME, return time. Format: 06: 48: 28
UNIX_TIMESTAMP, returns an integer timestamp, for example, 1348408108
SYSDATE, return time. The format is the same 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:
NOW:
The two returned values are the same, because they indicate the start time of the statement.
SYSDATE is executed as follows:
Because of this difference, we usually use NOW () when executing the statement, because SYSDATE obtains the real-time at that time, this may lead to different execution return values of the master database and slave database, resulting in inconsistent Master/Slave Data.
Other functions are executed as follows:
,