SQL Current Date

To get the current date in SQL Server use the GETDATE() function. Here is an example:

[cc lang=”sql”]
SELECT CurrentDate = GETDATE()
[/cc]

SQL-Current-Date-GetDate

Current Date

GetDate() returns a datetime data type value.

There are also other methods in SQL Server that will return the current date. These are less commonly used. In fact, I have never personally had a need to use any of them except GETDATE().

[cc lang=”sql”]
SELECT SYSDATETIME()
SELECT SYSDATETIMEOFFSET()
SELECT SYSUTCDATETIME()
SELECT CURRENT_TIMESTAMP
SELECT GETDATE()
SELECT GETUTCDATE()
[/cc]
sql current date alternative

Featured Articles

 Site Author

  • Thanks for visiting!
css.php