您好,欢迎访问一九零五行业门户网

C#中获取TimeZoneInfo

c#中获取timezoneinfo
public timezoneinfo timezoneinfo { get { var timezoneinfostring = _user.timezoneinfostring; if (!string.isnullorempty(timezoneinfostring)) { try { return timezoneinfo.findsystemtimezonebyid(timezoneinfostring); } catch (timezonenotfoundexception exception) { logmanager.getlogger(gettype()).error(exception); } catch (exception exception) { logmanager.getlogger(gettype()).error(exception); } return timezoneinfo.local; } else { logmanager.getlogger(gettype()).errorformat("timezoneinfostring for user {0} is empty", httpcontext.current.user.identity.name); return timezoneinfo.local; } } }
其中,_user.timezoneinfostring会存在数据库中
以上就是c#中获取timezoneinfo的内容。
其它类似信息

推荐信息