CURRENT_TIMESTAMP
CURRENT_TIMESTAMP is a SQL function that retrieves the current date and time set on the system where the database resides. The return type of this function is a TIMESTAMP value.
CURRENT_TIMESTAMP()
Example
Output
Explanation
This example selects the current date and time from the server where the database is running, returned in ‘YYYY-MM-DD HH:MM:SS’ format. In MySQL, CURRENT_TIMESTAMP is a function that retrieves the current date and time.
CURRENT_TIMESTAMP()
Example
Output
Explanation
The code executes a SQL command to fetch the current timestamp in PostgreSQL. The timestamp includes the date and time up to the microsecond, following the UTC format.
CURRENT_TIMESTAMP
Example
Output
Explanation
The CURRENT_TIMESTAMP
function in SQL Server returns the current timestamp of the system in the format ‘yyyy-mm-dd hh:mi:ss.mmm’.
CURRENT_TIMESTAMP
Example
Output
Explanation
The CURRENT_TIMESTAMP
function in this Oracle SQL code snippet retrieves the current date and time according to the system. This timestamp includes the date, hour, minute, second, and fractional second. It’s augmented with timezone data, indicating the current timezone offset from UTC. The FROM dual
clause is a syntax specific to Oracle, which is used when there is no actual table to select from.
CURRENT_TIMESTAMP
Example
Output
Explanation
The CURRENT_TIMESTAMP
function in SQLite returns the current date and time as a string in the format YYYY-MM-DD HH:MM:SS
.