ASP.Net中DateTime的默认时区 [英] Default timezone for DateTime in asp.Net

查看:60
本文介绍了ASP.Net中DateTime的默认时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果未指定时区,则如何确定DateTime实例的默认时区.例子:居住在时区A中的用户访问时区B中服务器上托管的网页:如果网站代码在dateTime实例上调用ToUniversalTime(),是否将时区A或时区B用作计算的基础?

What determines the default timezone for a DateTime instance if no timezone is specified. Example: A user living in timezone A visits a webpage hosted on a server in timezone B: If the website code calls ToUniversalTime() on a dateTime instance, will timezone A or timezone B be used as the bases for the calculation?

预先感谢

推荐答案

所有 DateTime 操作都发生在服务器的本地时区或UTC中.

All DateTime operations occur in the server's local timezone, or in UTC.

ASP.Net完全不知道用户的时区.

ASP.Net is completely unaware of the user's time zone.

这篇关于ASP.Net中DateTime的默认时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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