SQL Server GetDate () and getUTCDate ()

Source: Internet
Author: User
Tags time zones local time

One, local time and UTC time

local time

Each region of the world has its own local time, the entire earth is divided into 24 time zones, each time zone has its own local time.

UTC time

In international radio communications, a standard time is commonly used for unification, known as universal Coordination (UTC, Universal times coordinated). UTC time is the same as the local time in London, UK.

UTC time is the same in all parts of the world, but in different time zones, local time varies. In SQL Sever, GetDate () returns the local time, and getUTCDate () returns the UTC time. UTC time is the same in different time zones, but local time is different.

Two, get local time and UTC time

GetDate () returns the DateTime of the local server, which is related to the OS of the PC on which the instance of SQL Server is located, the same time as the OS displays.

Returns the current database system timestamp as a datetime value without the database time zone offset. This value was derived from the operating system of the computer on which the instance of SQL Server is running.

getUTCDate ()

Returns the current database system timestamp as a datetime value. The database time zone offset is not included. This value represents the current UTC time (coordinated Universal time). This value was derived from the operating system of the computer on which the instance of SQL Server is running.

Third, the time that the SQL Agent executes the job

The time used in the SQL Server agent is local time, one job, and the time it takes to execute is local time.

SQL Server GetDate () and getUTCDate ()

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.