CodesJava

Easy learning with example program codes

CURRENT_TIMESTAMP() FUNCTION in MySQL

CURRENT_TIMESTAMP() FUNCTION
The MySQL CURRENT_TIMESTAMP function is used to get the current date and time. The various versions of MySQL supports the CURRENT_TIMESTAMP function, namely, MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0 and MySQL 3.23.

Syntax:

CURRENT_TIMESTAMP( )

Example 1:

mysql> SELECT CURRENT_TIMESTAMP();

Output:

'2019-07-05 15:30:20'

Explanation:
The current date and time has been returned as the result.

Example 2:

mysql> SELECT CURRENT_TIMESTAMP() + 2;

Output:

20190705153022.000000

Explanation:
The date and time value which is 2 seconds after the current time has been returned as the result.

Please follow and like us:
error









Copyright © 2019 CodesJava DMCA.com Protection Status