SYSDATE() returns the current date and time. : SYSDATE : Date Time Functions MySQL TUTORIALS


MySQL TUTORIALS » Date Time Functions » SYSDATE »

 

SYSDATE() returns the current date and time.


The format is 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS format, depending on whether the function is used in a string or numeric context.

SYSDATE() returns the time at which it executes.

NOW() returns a constant time that indicates the time at which the statement began to execute.

The SET TIMESTAMP statement affects the value returned by NOW() but not by SYSDATE().

mysql>
mysql> SELECT NOW(), SLEEP(2), NOW();
+---------------------+----------+---------------------+
| NOW()               | SLEEP(2| NOW()               |
+---------------------+----------+---------------------+
2007-07-22 19:46:18 |        2007-07-22 19:46:18 |
+---------------------+----------+---------------------+
row in set (2.00 sec)

mysql>
mysql> SELECT SYSDATE(), SLEEP(2), SYSDATE();
+---------------------+----------+---------------------+
| SYSDATE()           | SLEEP(2| SYSDATE()           |
+---------------------+----------+---------------------+
2007-07-22 19:46:20 |        2007-07-22 19:46:22 |
+---------------------+----------+---------------------+
row in set (2.00 sec)

mysql>
mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Date Time Functions
» SYSDATE