THE WORLD'S LARGEST WEB DEVELOPER SITE

SQL Server GETDATE() Function

❮ SQL Server Functions

Example

Return the current date and time:

SELECT GETDATE();
Try it Yourself »

Definition and Usage

The GETDATE() function returns the current date and time, in a 'YYYY-MM-DD hh:mm:ss.mmm' format.

Tip: See also the CURRENT_TIMESTAMP function.

Syntax

GETDATE()

Technical Details

Works in: SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005

❮ SQL Server Functions