小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

TimeZoneInfo

 趙靜Library 2014-03-03

TimeZoneInfo 擴展了 TimeZone 類

TimeZone 類只識別本地時區(qū),但可以在協(xié)調世界時 (UTC) 和本地時間之間轉換時間。TimeZoneInfo 對象可以表示任意時區(qū),且 TimeZoneInfo 類的方法可用于將一個時區(qū)的時間轉換為其他任意時區(qū)的相應時間。

 

TimeZoneInfo timeZoneInfoLocal = TimeZoneInfo.Local;
        string s = timeZoneInfoLocal.DaylightName + "," + timeZoneInfoLocal.DisplayName + ","
            + timeZoneInfoLocal.Id + "," + timeZoneInfoLocal.StandardName + "," + timeZoneInfoLocal.SupportsDaylightSavingTime;

        //獲取本地時間對應的標準時間(UTC)
        DateTime utc=TimeZoneInfo.ConvertTimeToUtc(DateTime.Now);
        //UTC轉化為本地時間
        DateTime nowTime = TimeZoneInfo.ConvertTimeFromUtc(utc, timeZoneInfoLocal);

        //獲取本地時間和UTC之間的差值--時差
        TimeSpan utcOffset =TimeZoneInfo.Local.BaseUtcOffset;
        TimeSpan utcOffset1 = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now);

 

        TimeSpan a = new TimeSpan(10, 0, 0);

        TimeZoneInfo timeZoneInfoHawaiian = TimeZoneInfo.CreateCustomTimeZone("Hawaiian Standard Time sss", a, "夏威夷", "Hawaiian");
        DateTime hawaiianTime = TimeZoneInfo.ConvertTimeFromUtc(utc, timeZoneInfoHawaiian);

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多