MySQL CURDATE() Function

MySQL | CURDATE() Function: Learn about the CURDATE() function, how it works, its usages, syntax, and examples.
Submitted by Apurva Mathur, on October 04, 2022

CURDATE() Function

To get the current date/ time we use CURDATE() function. It returns us the current date.

CURDATE() Syntax

SELECT CURDATE();

CURDATE() Parameter(s)

  • N/A

CURDATE() Return Value

It returns the current date in the format of 'YYYY-MM-DD' if the function is used in a string context. Or, it returns in the format of YYYYMMDD if the function is used in numeric context.

MySQL CURDATE() Function Example 1

SELECT CURDATE();
Example 1: MySQL CURDATE() Function

MySQL CURDATE() Function Example 2

SELECT CURDATE()+ 20;

This expression will give you the date + 20.

Example 2: MySQL CURDATE() Function


Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.