Cross-region time of SQL Server databases

Source: Internet
Author: User
Tags time zones

Recently, I encountered a problem: Solving the Problem of displaying the time of American and Chinese companies. The current database records the United States time and displays the China time zone on the Chinese webpage. And consider the issue of timeout.

The SQL Server 2005 data time format does not support international time zones.

The time format of SQL Server 2008 solves the time zone problem. Provides the related data class new datetimeoffset type and related functions.

After SQL Server 2008, the database has enhanced the time format type. A new data type datetimeoffset for time internationalization is added and a series of related functions are provided. Because this time type records the time zone of the time, it may be helpful for the multi-language setting of clims4.

In addition, the old-fashioned datatime data type may be replaced by the datetime2 type. We recommend that you use the datetime type with caution in the future.

The switchdatatimesoffset function does not support the change during renewal. As follows:

Is a character string in the format [+ |-] tzh: tzm or a signed integer (of minutes) that represents the time zone offset, andIs assumed to be daylight-saving aware and adjusted.

 

 

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.