Windows Azure Web Site (8) 设置Web Site时区

简介:

 《Windows Azure Platform 系列文章目录

 

  许多已经使用Azure Web Site的用户已经发现了,Azure Web Site默认的系统时间是UTC时区。

 

  比如我们在本地使用Visual Studio 2013创建Web Site项目,在Default.aspx.cs输入以下代码:

   Label1.Text = DateTime.Now.ToString();

  编译通过后,在本地调试显示的是本地系统时间。

  而我们部署到Azure Web Site之后,显示的是UTC时区。如下图:

  

 

  其实我们可以通过Web Site配置页面,来设置Web Site的当前时间,如下图:

  

  增加应用配置,如下图:

  

  设置WEBSITE_TIME_ZONE,值设置为China Standard Time。

  这样就可以把默认的UTC时区,设置为中国区时间,即UTC+8时区。

 

  这样显示的系统时间就为UTC+8时区,如下图:

  

 

 

  其他Time Zone时区,可以查询http://zonetime.azurewebsites.net/

 

  

  本博-三石Blog(下文简称本博),在本博客文章结尾处右下脚未注明转载、来源、出处的作品(内容)均为本博原创,本站对于原创作品内容对其保留版权,请勿随意转载,如若真有需要的朋友可以发Mail联系我;转载本博原创作品(内容)也必须遵循“署名-非商业用途-保持一致”的创作共用协议,请务必以文字链接的形式标明或保留文章原始出处和博客作者(Lei Zhang)的信息,关于本博摄影作品请务必注意保留(www.cnblog.com/threestone)等相关水印版权信息,否则视为侵犯原创版权行为;本博谢绝商业网站转载。版权所有,禁止一切有违中华人民共和国著作权保护法及相关法律和本博(法律)声明的非法及恶意抄袭。


本文转自Lei Zhang博客园博客,原文链接:http://www.cnblogs.com/threestone/p/4828804.html,如需转载请自行联系原作者

目录
相关文章
|
4月前
|
人工智能 安全 网络安全
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
225 4
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
|
4月前
|
安全 Devops 测试技术
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
86 0
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
|
7月前
|
人工智能 Linux iOS开发
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
346 12
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
|
7月前
|
安全 JavaScript Java
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
93 12
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
|
6月前
|
自然语言处理 安全 测试技术
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试
336 0
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试
|
10月前
|
安全 Windows
【Azure Cloud Service】在Windows系统中抓取网络包 ( 不需要另外安全抓包工具)
通常,在生产环境中,为了保证系统环境的安全和纯粹,是不建议安装其它软件或排查工具(如果可以安装,也是需要走审批流程)。 本文将介绍一种,不用安装Wireshark / tcpdump 等工具,使用Windows系统自带的 netsh trace 命令来获取网络包的步骤
205 32
|
10月前
|
C# Windows
【Azure App Service】在App Service for Windows上验证能占用的内存最大值
根据以上测验,当使用App Service内存没有达到预期的值,且应用异常日志出现OutOfMemory时,就需要检查Platform的设置是否位64bit。
160 11
|
10月前
【Azure App Service】PowerShell脚本批量添加IP地址到Web App允许访问IP列表中
Web App取消公网访问后,只允许特定IP能访问Web App。需要写一下段PowerShell脚本,批量添加IP到Web App的允许访问IP列表里!
147 2
|
11月前
|
安全 网络协议 网络安全
Windows Server 2003 Web服务器搭建
Windows Server 2003 Web服务器搭建
138 1
|
11月前
|
网络协议 Windows
Windows Server 2019 Web服务器搭建
Windows Server 2019 Web服务器搭建
456 0