- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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