If you want to find current datetime in SQL Server I suggest to read the following post :
SQL SERVER – Retrieve Current Date Time in SQL Server CURRENT_TIMESTAMP, GETDATE(), {fn NOW()}
This post is related to new feature available in SQL Server 2008. In SQL Server 2008 there is a function which provides current offset of the system from GMT time as well. Basically it shows the system datetime with offset. I think this can be useful in some of the instances where SQL Server are depending on the time offset.
SELECT SYSDATETIMEOFFSET() AS 'Windows System Time'
GO
Reference : Pinal Dave (https://blog.sqlauthority.com)
2 Comments. Leave new
nice, thanks
Can you help me how to check if hte system time is great than 11:00pm?
eg: i want to chek like select convert(varchar,getdate(),108) > ’11:00′