
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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)
- Related Questions & Answers
- Get date format DD/MM/YYYY with MySQL Select Query?
- MySQL date format DD/MM/YYYY select query?
- Convert MySQL date format from yyyy-mm-ddThh:mm:ss.sssZ to yyyy-mm-dd hh:mm:ss ?
- MySQL query to convert YYYY-MM-DD to DD Month, YYYY date format
- MySQL date format to convert dd.mm.yy to YYYY-MM-DD?
- How to format JavaScript date into yyyy-mm-dd format?
- Java Program to format date in mm-dd-yyyy hh:mm:ss format
- How to parse Date from String in the format: dd/MM/yyyy to dd/MM/yyyy in java?
- Converting date from 'dd/mm/yyyy' to 'yyyymmdd' in MySQL
- Accepting date strings (MM-dd-yyyy format) using Java regex?
- Program to reformat date in YYYY-MM-DD format using Python
- How to insert mm/dd/yyyy format dates in MySQL?
- Change date format (in DB or output) to dd/mm/yyyy in PHP MySQL?
- Format date with SimpleDateFormat('MM/dd/yy') in Java
- How to format a string to date in as dd-MM-yyyy using java?
Advertisements