GETDATE
GETDATE is a built-in function in Microsoft SQL Server and Azure SQL Database that returns the current date and time from the server’s clock. It takes no arguments and is commonly used to timestamp rows, record events, or generate time-based values in queries.
The function returns a value of the datetime data type, which has a precision of about 3.33
GETDATE is non-deterministic, meaning its result can vary between calls within the same session or query due
Common usage examples include:
- SELECT GETDATE() AS CurrentTime;
- SELECT CAST(GETDATE() AS date) AS TodayDate;
Related functions include GETUTCDATE(), which returns the current date and time in UTC, and CURRENT_TIMESTAMP, the
Notes emphasize that the reported time depends on the server’s clock and time zone settings. For cross-server