从迁移本地服务器天青:时区UTC。如何解决? [英] Migration from local server to Azure: TIMEZONE UTC. How to solve?

查看:286
本文介绍了从迁移本地服务器天青:时区UTC。如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计我的应用程序考虑的事实是,根据规格,
应设在意大利和客户端的服务器上运行,将只有意大利人。

I designed my application considering the fact that, according to the specifications, should run on a server located in Italy and clients will be italian people only.

大约一​​个月前,我决定BOS把它所有在Azure上。

About a month ago, my bos decided to bring it all on Azure.

一切顺利。那给我一些问题的唯一的事情是,时间服务器是UTC的事实。

Everything went smoothly. The only thing that give me some problem is the fact that the time server is UTC.

的解决方案是:

A)简单

修改启动脚本到服务器时(
http://netindonesia.net/blogs/wely/archive/2011/06/26/setting-timezone-in-windows-azure.aspx

modify a startup script to the server time ( http://netindonesia.net/blogs/wely/archive/2011/06/26/setting-timezone-in-windows-azure.aspx )

B)比较费力

换作任何应用程序使用UTC与显示时间正确转换为本地时间。

Change to make any application to use UTC and show the time properly converted to local time.

如果我去的溶液中的我的疑问是,事实是,服务器设置了不同的时区可以以某种方式产生冲突与Azure上。

If i go for the solution A my doubt is that the fact that the server is set up with a different timezone can somehow create conflicts with Azure.

这是真的吗?

推荐答案

我问MS支持。

这是响应:

更改使用启动任务在Azure虚拟机服务器时,不建议,你倒是应该使用类似的方法TimeZoneInfo.ConvertTimeFromUTCTime在code。

Changing the server time on the Azure Virtual Machines using a startup task is not recommended, you should rather use methods like TimeZoneInfo.ConvertTimeFromUTCTime in your code.

所以我不会改变服务器的时区。
等待来自支持的响应我发现SqlServer的2008年有一个是完美的一个的DateTimeOffset数据类型!

So I will not change the server timezone. Waiting for a response from the support I discover that SqlServer 2008 have a DateTimeOffset data type that is perfect!

<一个href=\"http://blogs.msdn.com/b/davidrickard/archive/2012/04/07/system-datetime-good-practices-and-common-pitfalls.aspx\">http://blogs.msdn.com/b/davidrickard/archive/2012/04/07/system-datetime-good-practices-and-common-pitfalls.aspx

这篇关于从迁移本地服务器天青:时区UTC。如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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