Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs

MySQL CURDATE Function

by suresh

MySQL Curdate function is a MySQL Date Function, which is useful to return the current date value in YYYY-MM-DD or YYYYMMDD format. The syntax of the Curdate Function in MySQL is as shown below:

CURDATE();

MySQL CURDATE Example

The following query shows you the basic use of this curdate function.

SELECT CURDATE();
MySQL CURDATE Example 1

As you can see from the above screenshot, it is showing today’s date in YYYY-MM-DD format. Let me show you another Date Function example with Alias Name.

SELECT CURDATE() AS 'Todays Date';
MySQL CURDATE Example 2

The following MySQL query shows you what happens when adding days to this current date function.

SELECT CURDATE() + 2 AS 'Date String';

SELECT CURDATE() + 12 AS 'Date String';
MySQL CURDATE Example 4

From the above screenshot, it added those days to the current date. Next, it is displaying the date in the YYYYMMDD string format.

Placed Under: MySQL

  • How to Download MySQL
  • Install MySQL on Windows
  • MySQL Create Database
  • MySQL Delete Database
  • MySQL Create Table
  • MySQL Drop Table
  • MySQL SELECT Statement
  • MySQL ALIAS Column
  • MySQL Distinct
  • MySQL Insert Statement
  • MySQL Delete
  • MySQL Truncate Table
  • MySQL WHERE Clause
  • MySQL Order By
  • MySQL Group By
  • MySQL Having Clause
  • MySQL LIMIT
  • MySQL Arithmetic Operators
  • MySQL COALESCE Function
  • MySQL AND Operator
  • MySQL NOT Operator
  • MySQL OR Operator
  • MySQL XOR Operator
  • MySQL BETWEEN Operator
  • MySQL Not Between Operator
  • MySQL GREATEST Function
  • MYSQL LEAST Function
  • MySQL LIKE Operator
  • MySQL NOT LIKE Operator
  • MySQL IFNULL Operator
  • MySQL NULLIF Operator
  • MySQL INTERVAL Operator
  • MySQL IS Operator
  • MySQL IN Operator
  • MySQL NOT IN Operator
  • MySQL IS NOT NULL
  • MySQL IS NULL
  • MySQL Inner Join
  • MySQL Cross Join
  • MySQL Right Join
  • MySQL Left Join
  • MySQL Aggregate Functions
  • MySQL Date Functions
  • MySQL Date Function
  • MySQL String Functions
  • MySQL Numeric Functions

Copyright © 2021 · All Rights Reserved by Suresh

About Us | Contact Us | Privacy Policy