title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | ms.custom | f1_keywords | helpviewer_keywords | dev_langs | monikerRange | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CURRENT_DATE (Transact-SQL) |
CURRENT_DATE returns the current database system date as a date value, without the database time and time zone offset. |
PratimDasgupta |
prdasgu |
randolphwest |
08/08/2024 |
sql |
t-sql |
reference |
|
|
|
|
>=aps-pdw-2016 || =azuresqldb-current || =azuresqldb-mi-current |
[!INCLUDE asdb-asdbmi]
In [!INCLUDE ssazure-sqldb] and [!INCLUDE ssazuremi-md], this function returns the current database system date as a date value, without the database time and time zone offset. CURRENT_DATE
derives this value from the underlying operating system on the [!INCLUDE ssde-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 CAST(GETDATE() AS DATE)
. For more information, see GETDATE.
See Date and time data types and functions for an overview of all the [!INCLUDE tsql] date and time data types and functions.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
[!INCLUDE ssazure-sqldb] and [!INCLUDE ssazuremi-md] only:
CURRENT_DATE
This function takes no arguments.
date
[!INCLUDE tsql] statements can refer to CURRENT_DATE
anywhere they can refer to a date expression.
CURRENT_DATE
is a nondeterministic function. Views and expressions that reference this column can't be indexed.
These examples use the 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. The actual values returned reflect the actual day / time of execution.
SELECT SYSDATETIME(),
SYSDATETIMEOFFSET(),
SYSUTCDATETIME(),
CURRENT_TIMESTAMP,
GETDATE(),
GETUTCDATE(),
CURRENT_DATE;
Note
CURRENT_DATE (Transact-SQL) is available in [!INCLUDE ssazure-sqldb] and [!INCLUDE ssazuremi-md] only.
[!INCLUDE ssresult-md]
Data type | Value |
---|---|
SYSDATETIME() |
2024-06-26 14:04:21.6172014 |
SYSDATETIMEOFFSET() |
2024-06-26 14:04:21.6172014 -05:00 |
SYSUTCDATETIME() |
2024-06-26 19:04:21.6172014 |
CURRENT_TIMESTAMP |
2024-06-26 14:04:21.617 |
GETDATE() |
2024-06-26 14:04:21.617 |
GETUTCDATE() |
2024-06-26 19:04:21.617 |
CURRENT_DATE |
2024-06-26 |
SELECT CONVERT(DATE, SYSDATETIME()),
CONVERT(DATE, SYSDATETIMEOFFSET()),
CONVERT(DATE, SYSUTCDATETIME()),
CONVERT(DATE, CURRENT_TIMESTAMP),
CONVERT(DATE, GETDATE()),
CONVERT(DATE, GETUTCDATE()),
CURRENT_DATE;
Note
CURRENT_DATE (Transact-SQL) is available in [!INCLUDE ssazure-sqldb] and [!INCLUDE ssazuremi-md] only.
[!INCLUDE ssresult-md]
Data type | Value |
---|---|
SYSDATETIME() |
2024-06-26 |
SYSDATETIMEOFFSET() |
2024-06-26 |
SYSUTCDATETIME() |
2024-06-26 |
CURRENT_TIMESTAMP |
2024-06-26 |
GETDATE() |
2024-06-26 |
GETUTCDATE() |
2024-06-26 |
CURRENT_DATE |
2024-06-26 |