--- title: "CURRENT_TIMESTAMP (Transact-SQL)" description: "CURRENT_TIMESTAMP (Transact-SQL)" author: markingmyname ms.author: maghan ms.date: "07/24/2017" ms.prod: sql ms.technology: t-sql ms.topic: reference f1_keywords: - "CURRENT_TIMESTAMP" - "CURRENT_TIMESTAMP_TSQL" helpviewer_keywords: - "dates [SQL Server], functions" - "niladic functions" - "current date and time [SQL Server]" - "time [SQL Server], current" - "date and time [SQL Server], CURRENT_TIMESTAMP" - "functions [SQL Server], time" - "system date and time [SQL Server]" - "system time [SQL Server]" - "functions [SQL Server], date and time" - "time [SQL Server], functions" - "dates [SQL Server], current date and time" - "dates [SQL Server], system date and time" - "CURRENT_TIMESTAMP function [SQL Server]" - "time [SQL Server], system" dev_langs: - "TSQL" monikerRange: ">= aps-pdw-2016 || = azuresqldb-current || = azure-sqldw-latest || >= sql-server-2016 || >= sql-server-linux-2017 || = azuresqldb-mi-current" --- # CURRENT_TIMESTAMP (Transact-SQL) [!INCLUDE [sql-asdb-asdbmi-asa-pdw](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)] This function returns the current database system timestamp as a **datetime** value, without the database time zone offset. `CURRENT_TIMESTAMP` derives this value from the operating system of the computer on which the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] runs. > [!NOTE] > `SYSDATETIME` and `SYSUTCDATE` have more precision, as measured by fractional seconds precision, than `GETDATE` and `GETUTCDATE`. The `SYSDATETIMEOFFSET` function includes the system time zone offset. You can assign `SYSDATETIME`, `SYSUTCDATETIME`, and `SYSDATETIMEOFFSET` to a variable of any of the date and time types. This function is the ANSI SQL equivalent to [GETDATE](../../t-sql/functions/getdate-transact-sql.md). See [Date and Time Data Types and Functions](../../t-sql/functions/date-and-time-data-types-and-functions-transact-sql.md) for an overview of all the [!INCLUDE[tsql](../../includes/tsql-md.md)] date and time data types and functions. ![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md) ## Syntax ```syntaxsql CURRENT_TIMESTAMP ``` [!INCLUDE[sql-server-tsql-previous-offline-documentation](../../includes/sql-server-tsql-previous-offline-documentation.md)] ## Arguments This function takes no arguments. ## Return Type **datetime** ## Remarks [!INCLUDE[tsql](../../includes/tsql-md.md)] statements can refer to `CURRENT_TIMESTAMP`, anywhere they can refer to a **datetime** expression. `CURRENT_TIMESTAMP` is a nondeterministic function. Views and expressions that reference this column cannot be indexed. ## Examples These examples use the six [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] system functions that return current date and time values, to return the date, the time, or both. The examples return the values in series, so their fractional seconds might differ. Note that the actual values returned will reflect the actual day / time of execution. ### A. Get the Current System Date and Time ```sql SELECT SYSDATETIME() ,SYSDATETIMEOFFSET() ,SYSUTCDATETIME() ,CURRENT_TIMESTAMP ,GETDATE() ,GETUTCDATE(); /* Returned: SYSDATETIME() 2007-04-30 13:10:02.0474381 SYSDATETIMEOFFSET()2007-04-30 13:10:02.0474381 -07:00 SYSUTCDATETIME() 2007-04-30 20:10:02.0474381 CURRENT_TIMESTAMP 2007-04-30 13:10:02.047 GETDATE() 2007-04-30 13:10:02.047 GETUTCDATE() 2007-04-30 20:10:02.047 */ ``` ### B. Get the Current System Date ```sql SELECT CONVERT (DATE, SYSDATETIME()) ,CONVERT (DATE, SYSDATETIMEOFFSET()) ,CONVERT (DATE, SYSUTCDATETIME()) ,CONVERT (DATE, CURRENT_TIMESTAMP) ,CONVERT (DATE, GETDATE()) ,CONVERT (DATE, GETUTCDATE()); /* Returned SYSDATETIME() 2007-05-03 SYSDATETIMEOFFSET()2007-05-03 SYSUTCDATETIME() 2007-05-04 CURRENT_TIMESTAMP 2007-05-03 GETDATE() 2007-05-03 GETUTCDATE() 2007-05-04 */ ``` ### C. Get the Current System Time ```sql SELECT CONVERT (TIME, SYSDATETIME()) ,CONVERT (TIME, SYSDATETIMEOFFSET()) ,CONVERT (TIME, SYSUTCDATETIME()) ,CONVERT (TIME, CURRENT_TIMESTAMP) ,CONVERT (TIME, GETDATE()) ,CONVERT (TIME, GETUTCDATE()); /* Returned SYSDATETIME() 13:18:45.3490361 SYSDATETIMEOFFSET()13:18:45.3490361 SYSUTCDATETIME() 20:18:45.3490361 CURRENT_TIMESTAMP 13:18:45.3470000 GETDATE() 13:18:45.3470000 GETUTCDATE() 20:18:45.3470000 */ ``` ## Examples: [!INCLUDE[ssSDWfull](../../includes/sssdwfull-md.md)] and [!INCLUDE[ssPDW](../../includes/sspdw-md.md)] ```sql SELECT CURRENT_TIMESTAMP; ``` ## See also [CAST and CONVERT (Transact-SQL)](../../t-sql/functions/cast-and-convert-transact-sql.md)