In this guide, we will explain how to use the MySQL SYSDATE function with syntax and examples.
Description
The MySQL SYSDATE function returns the current date and time.
Syntax
The syntax for the SYSDATE function is:
SYSDATE( )
Parameters or Arguments
There are no parameters or arguments for the SYSDATE function.
Note
- The SYSDATE function will return the current date as a ‘YYYY-MM-DD HH:MM:SS’ format, if used in a string context.
- The SYSDATE function will return the current date as a YYYYMMDDHHMMSS format, if used in a numeric context.
Applies To
The SYSDATE function can be used in the following versions :
- MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23
Example
Let’s look at some SYSDATE function examples and explore how to use the SYSDATE function.
For example:
mysql> SELECT SYSDATE(); Result: '2014-02-17 10:27:21' mysql> SELECT SYSDATE() + 0; Result: 20140217102721 mysql> SELECT SYSDATE() + 1; Result: 20140217102722
Next Topic : Click Here
Pingback: MySQL: SUBTIME Function | Adglob Infosystem Pvt Ltd