Total Pageviews

GETDATE () and GETUTCDATE () in SQL Server

GETDATE ()
·         It will return the date with your regional time or we can say, it returns the current system date and time.
·         If you are connected to the SQL server remotely then the timestamp displayed will be the timestamp of the remote machine and not your local machine.
·         It is a nondeterministic function.
·         Views and expressions that reference this column cannot be indexed.

GETUTCDATE ()
·         It will return the date and GMT time (Greenwich Mean Time).
·         GETUTCDATE () can be used to store the timestamp that is independent of Time Zones.
·         The current UTC time is derived from the current local time and the time zone setting in the operating system of the computer on which the instance of Microsoft SQL Server is running.
·         GETUTCDATE is a nondeterministic function.
·         Views and expressions that reference this column cannot be indexed.


facebook page




No comments:

Post a Comment