赶来时差 [英] Time difference catched

查看:64
本文介绍了赶来时差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的CPU正确显示美国东部时间。但是,在我的.Net程序中,我使用DateTime.Now显示时间落后4小时(例如我的CPU右下角早上7:55,程序中的凌晨3:55)。怎么调整?谢谢。

My CPU show US Eastern Time correctly. However, in my .Net program, I use DateTime.Now shows the time is 4 hours behind (e.g. 7:55am in my CPU's right-bottom, 3:55am in my program). How can it be adjusted? Thanks.

推荐答案

当前时区被缓存,有时会出现像你这样的小问题。您可能已经插入了时区或手动将时间调整为+/-几个小时。

您需要调用System.Globalization.CultureInfo.ClearCachedData()方法来清除缓存的值。
Current timezone is cached and sometimes hiccups like yours can occur. You have probably meddled with timezone or have manually adjusted time to +/- several hours.
You'll need to call System.Globalization.CultureInfo.ClearCachedData() method to clear cached value.


这篇关于赶来时差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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