SQL SERVER – 2008 – Find Current System Date Time and Time Offset

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 (http://blog.SQLAuthority.com)

About these ads

2 thoughts on “SQL SERVER – 2008 – Find Current System Date Time and Time Offset

  1. 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′

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s