SQL Server: GETDATE function

This SQL Server tutorial explains how to use the GETDATE function in SQL Server (Transact-SQL) with syntax and examples.


In SQL Server (Transact-SQL), the GETDATE function returns the current date and time.


The syntax for the GETDATE function in SQL Server (Transact-SQL) is:


Parameters or Arguments

There are no parameters or arguments for the GETDATE function.


  • The GETDATE function returns the system date and time in the format ‘yyyy-mm-dd hh:mi:ss.mmm‘.
  • See also the CURRENT_TIMESTAMP function.

Applies To

The GETDATE function can be used in the following versions of SQL Server (Transact-SQL):

  • SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005


Let’s look at some SQL Server GETDATE function examples and explore how to use the GETDATE function in SQL Server (Transact-SQL).

For example:

Result: '2014-04-28 18:17:28.160'