MySQL CURRENT_TIMESTAMP() Function

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

CURRENT_TIMESTAMP() Function

This function helps us to get the current date and time both. We have seen many functions which give us the current date or current time but this function returns us both i.e. current date and current time.

CURRENT_TIMESTAMP() Syntax

SELECT CURRENT_TIMESTAMP();

CURRENT_TIMESTAMP() Parameter(s)

  • No parameters are given in this function.

CURRENT_TIMESTAMP() Return Value

This function returns us the current date and time both in YYYY-MM-DD HH:MM:SS format by default but if you add any integer/numeric value to this function then in such case it will return you the value in YYYYMMDDHHMMSS format.

MySQL CURRENT_TIMESTAMP() Function Example 1

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

MySQL CURRENT_TIMESTAMP() Function Example 2

SELECT CURRENT_TIMESTAMP()+6;
Example 2: MySQL CURRENT_TIMESTAMP() Function


Comments and Discussions!

Load comments ↻





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