TimeZoneInfo类不返回正确的信息 [英] TimeZoneInfo Class Doesnt Return Correct Info

查看:59
本文介绍了TimeZoneInfo类不返回正确的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,伙计,我使用timezoneinfo类返回当前系统的timezoneinfo,这是我的代码

hey guyz i have used timezoneinfo class to return the timezoneinfo of current system here is my code

string t = TimeZoneInfo.Local.Id;
string displayname = TimeZoneInfo.Local.DisplayName;


第一次显示我正确,但是当我从时钟更改时区时,它仍然显示旧时区,任何机构都可以帮助我吗?


it displays me correct at the first time but when i change my timezone from clock it still shows me old timezone can any body plz help me out?

推荐答案

第一次显示我正确,但是当我从时钟更改时区时,它仍然显示旧时区
如果您的Web服务器与您正在浏览的计算机不同,则将发生这种情况.代码将在服务器上运行,您将获得服务器时间.更改客户端系统上的时区不会对其造成影响.
it displays me correct at the first time but when i change my timezone from clock it still shows me old timezone
If your webserver is differnet from the machine you are browsing then this will happen. You will get server time as the code is running on the server. Changing timezone on client system will not affect it.


这篇关于TimeZoneInfo类不返回正确的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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