返回首页 股票大厅 市场分析 筹码收集 机构报告 个股分析 金融学堂 期指期货 理论图书 席位资金 价值投资 休闲社区 贴图摄影 养生养颜
免费:必涨⑤只黑马股
强烈推荐③只暴涨牛股
杨百万:投资3只牛股
免费公开③只必涨黑马
庄家拉升3只暴涨牛股
推荐明日③只涨停黑马
三只黑马月获利80%
最新推荐暴涨牛股名单
每天推荐一个涨停牛股
今日 5只涨版牛股-图
发新话题
打印

[06-17] TimeZoneInfo不同时区的时间转换

本主题由 西边 于 2008-11-13 14:06 关闭

[06-17] TimeZoneInfo不同时区的时间转换

1.枚举计算机上存在的时区
        void write() {
            ReadOnlyCollection<TimeZoneInfo> tzCollection;
            tzCollection = TimeZoneInfo.GetSystemTimeZones();
            foreach (TimeZoneInfo timeZone in tzCollection)
                Console.WriteLine("   {0}: {1}", timeZone.Id, timeZone.DisplayName);
        }

2.不同时区的时间转换
   public static class Common
    {
        const string  Source= "GMT Standard Time";
        const string target= "China Standard Time";
        public static DateTime GetTime(DateTime time) {
            return TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.SpecifyKind(time, DateTimeKind.Unspecified), SourceID, target);
        }
    }
抢钱,抢粮,抢地盘!
发新话题