GETDATE
GETDATE()
Section titled “GETDATE()”Example
Section titled “Example”SELECT GETDATE() AS CurrentDateTime;Output
Section titled “Output”---------------CurrentDateTime---------------2022-10-10 18:40:12.123Explanation
Section titled “Explanation”The GETDATE() function retrieves the current date and time from the SQL Server. The result is returned in ‘YYYY-MM-DD hh:mm:ss.mmm’ format. In the provided example, CurrentDateTime shows the current date and time at which the query was executed.