CURDATE(), CURRENT_DATE(), CURTIME(), CURRENT_TIME(), CURRENT_TIMESTAMP(), and NOW() Functions : CURDATE « Date Time « SQL / MySQL






CURDATE(), CURRENT_DATE(), CURTIME(), CURRENT_TIME(), CURRENT_TIMESTAMP(), and NOW() Functions

    
mysql>
mysql>
mysql> SELECT CURDATE();
+------------+
| CURDATE()  |
+------------+
| 2011-10-03 |
+------------+
1 row in set (0.00 sec)

mysql> SELECT CURTIME();
+-----------+
| CURTIME() |
+-----------+
| 20:56:41  |
+-----------+
1 row in set (0.00 sec)

mysql> SELECT NOW();
+---------------------+
| NOW()               |
+---------------------+
| 2011-10-03 20:56:41 |
+---------------------+
1 row in set (0.00 sec)

mysql>

   
    
    
    
  








Related examples in the same category

1.Determining the Current Date or Time
2.Check current date in where clause
3.To find out what date it is, according to the server, you can use the CURRENT_DATE() function