Overview
The CURRENT_TIMESTAMP function returns the current server time stamp using the datetime format.
Explanation
This function is an ANSI SQL standard and it returns the same value the GETDATE() function returns. It is recommended to use this function instead of GETDATE(), because this function is an ANSI standard while GETDATE() is a SQL Server specific function.
Syntax
CURENT_TIMESTAMPParameters
- No parameters required
Simple CURRENT_TIMESTAMP Example
The following is a simple CURRENT_TIMESTAMP example.
SELECT CURRENT_TIMESTAMP as timestamp
Difference between GETDATE() and CURRENT_TIMESTAMP
The following example shows that there are differences between the GETDATE() function and CURRENT_TIMESATAMP.
SELECT DATEDIFF(SECOND, GETDATE(), CURRENT_TIMESTAMP) as difference
How to set the CURRENT_TIMESTAMP with a Custom Format
The following example will show the CURRENT_TIMESTAMP in the dd-MM-yyyy hh:mm:ss tt format.
SELECT FORMAT(CURRENT_TIMESTAMP, 'dd-MM-yyyy hh:mm:ss tt') as formatdate
How to set the CURRENT_TIMESTAMP with a Different Cultural Format
The following example will set the CURRENT_TIMESTAMP in the Japanese date format.
SELECT FORMAT (CURRENT_TIMESTAMP, 'dddd dd, MMMM, yyyy', 'ja-jp') as japanese
Using CURRENT_TIMESTAMP with Data from a Table
The following example will show ProductIDs with a StartDate between 8 and 9 years ago using CURRENT_TIMESTAMP as the current time.
SELECT Productid, DATEDIFF(YEAR, StartDate, CURRENT_TIMESTAMP) as years
FROM Production.ProductCostHistory
WHERE DATEDIFF(YEAR, StartDate, CURRENT_TIMESTAMP) BETWEEN 8 AND 9
Additional Information
- How to Get Current Date in SQL Server
- Mimic timestamp behavior of other database platforms to store last modified date
- SQL Convert Date to YYYYMMDD
- SQL DATEDIFF

Daniel Calbimonte is a Microsoft Most Valuable Professional, Microsoft Certified Trainer and Microsoft Certified IT Professional for SQL Server. He is an accomplished SSIS author, teacher at IT Academies and has over 10 years of experience as a QE and developer for SQL Server related software. He has worked for the government, oil companies, web sites, magazines and universities around the world. Daniel also regularly speaks at SQL Servers conferences and blogs.
- MSSQLTips Awards: Author of the Year Contender – 2015-2018, 2022, 2023 | Champion (100+ tips) – 2018



Jeff,
Thank you for the feedback. We will get this on the list to get updated.
Thank you,
Jeremy Kadlec
Community Co-Leader
Nice article but teaching how to use FORMAT without teaching how to do the equivalent CONVERT is a serious oversight, IMHO, because of the fact that FORMAT is at least 17 times slower and up to 27 times slower than CONVERT.
Yep… I know CONVERT is taught later on but, IMHO, MUST at least be demonstrated when FORMAT is demonstrated for the reason I stated.