RSS

Get Current DateTime – SQL Server !!

04 Jun

Stopwatch_2

All system date and time values are derived from the operating system of the computer on which the instance of SQL Server is running.

Higher-Precision System Date and Time Functions:

  • SYSDATETIME = Returns a datetime2(7) value that contains the date and time of the computer on which the instance of SQL Server is running. The time zone offset is not included.
  • SYSDATETIMEOFFSET = Returns a datetimeoffset(7) value that contains the date and time of the computer on which the instance of SQL Server is running. The time zone offset is included.
  • SYSUTCDATETIME = Returns a datetime2(7) value that contains the date and time of the computer on which the instance of SQL Server is running. The date and time is returned as UTC time (Coordinated Universal Time).

01

Lower-Precision System Date and Time Functions:

  • CURRENT_TIMESTAMP = Returns a datetime value that contains the date and time of the computer on which the instance of SQL Server is running. The time zone offset is not included.
  • GETDATE = Returns a datetime value that contains the date and time of the computer on which the instance of SQL Server is running. The time zone offset is not included.
  • GETUTCDATE = Returns a datetime value that contains the date and time of the computer on which the instance of SQL Server is running. The date and time is returned as UTC time (Coordinated Universal Time).

02

You can get a lot of information about this topic from this LINK.

 
Leave a comment

Posted by on June 4, 2013 in MS SQL Server

 

Tags: , , , , , , , , , , , ,

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

 
%d bloggers like this: