c# 创建自定义时区

来源:互联网 发布:sql中双引号转义 编辑:程序博客网 时间:2024/05/16 01:58

做一个世界时间显示的问题,朋友的电脑上没有东京时区,只能自己创建东京时区.

 

 

 TimeZoneInfo tokyoTimeZone = null;       private void Clock_Load(object sender, EventArgs e)        {            string displayName = "(GMT+09:00) Antarctica/Mawson Time";            string standardName = "Tokyo Standard Time";            TimeSpan offset = new TimeSpan(09, 00, 00);            tokyoTimeZone = TimeZoneInfo.CreateCustomTimeZone(standardName, offset, displayName, standardName);}



 

原创粉丝点击