Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Get today's date in (YYYY-MM-DD) format in MySQL?
To get today’s date in (YYYY-MM-DD) format in MySQL, you can use CURDATE().
Following is the query to get the current date:
mysql> SELECT CURDATE();
This will produce the following output:
+------------+ | CURDATE() | +------------+ | 2019-04-09 | +------------+ 1 row in set (0.00 sec)
You can also use NOW() for this. Following is the query:
mysql> SELECT DATE(NOW());
This will produce the following output
+-------------+ | DATE(NOW()) | +-------------+ | 2019-04-09 | +-------------+ 1 row in set (0.00 sec)
Advertisements
