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

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

问题描述

我设计了我的应用程序,考虑到根据规范,
应该在位于意大利的服务器上运行,客户只能是意大利人。



大约一个月前,我的bos决定把它全部放在Azure上。



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



解决方案是:



A)简单



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



B)更费力 / p>

更改以使任何应用程序使用UTC并显示正确转换为本地时间的时间。



如果我去对于解决方案我的怀疑是,服务器设置不同的时区可能会以某种方式与Azure产生冲突。



这是真的吗?

解决方案

我已经要求MS支持。



这是响应: p>

更改Azure上的服务器时间不推荐使用启动任务的虚拟机,您应该在代码中使用TimeZoneInfo.ConvertTimeFromUTCTime等方法。



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



http://blogs.msdn.com/b /davidrickard/archive/2012/04/07/system-datetime-good-practices-and-common-pitfalls.aspx


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.

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

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

The solutions are:

A) simple

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

B) more laborious

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

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.

This is true?

解决方案

I have asked to MS support.

This is the response:

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.

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!

http://blogs.msdn.com/b/davidrickard/archive/2012/04/07/system-datetime-good-practices-and-common-pitfalls.aspx

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

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