在 SQL Server 2008 R2 中获取时区 [英] Get Time zones in SQL Server 2008 R2

查看:81
本文介绍了在 SQL Server 2008 R2 中获取时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Microsoft SQL Server 2008R2 中获取时区列表?

How can I get time zones list in Microsoft SQL Server 2008R2?

推荐答案

在 SQL Server 2008 中使用时区数据
http://blogs.msdn.com/b/sqlprogrammability/archive/2008/03/18/using-time-zone-data-in-sql-server-2008.aspx.

如果我对博客条目的理解正确,SQL Server 2008 R2 中没有时区列表,因为这样的列表没有国际公认的标准.相反,Microsoft 提供了 datetimeoffset 数据类型,它允许您使用数字时区偏移.

If I understand the blog entry correctly, there is no time zones list in SQL Server 2008 R2, because there is no internationally recognized standard for such a list. Instead, Microsoft offers a datetimeoffset data type, which allows you to work with numeric time zone offsets.

但是,本文确实提供了一些用于构建您自己的时区列表的试探性解决方案.特别是,它提供了一个示例程序,该程序使用 .NET 库将 Olson Timezone 数据库 (http://www.twinsun.com/tz/tz-link.htm) 中的数据写入表中,然后可以将其导入进入 SQL Server.

However, the article does offer some tentative solutions for building your own time zone list. In particular, it offers an example program that uses a .NET library to write data from the Olson Timezone database (http://www.twinsun.com/tz/tz-link.htm) into a table, which can then be imported into SQL Server.

这篇关于在 SQL Server 2008 R2 中获取时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆