Windows跟Linux的不同处理
生活随笔
收集整理的這篇文章主要介紹了
Windows跟Linux的不同处理
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1. 時(shí)區(qū)
1.1 北京時(shí)間
Windows:TimeZoneInfo.FindSystemTimeZoneById("China Standard Time");
Linux:TimeZoneInfo tzBeijing = TimeZoneInfo.FindSystemTimeZoneById("Asia/Shanghai");
1.2 美東時(shí)間
Window:?TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); //美國東部時(shí)區(qū)
Linux:TimeZoneInfo.FindSystemTimeZoneById("America/New_York");
?
在Windows下執(zhí)行獲取的代碼,遷移到Linux后報(bào):
System.TimeZoneNotFoundException: The time zone ID 'China Standard Time' was not found on the local computer. ---> System.IO.FileNotFoundException: Could not find file '/usr/share/zoneinfo/China Standard Time'.轉(zhuǎn)載于:https://www.cnblogs.com/crazylight/p/10833112.html
總結(jié)
以上是生活随笔為你收集整理的Windows跟Linux的不同处理的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数据结构:邻接矩阵
- 下一篇: 项目管理计划包含哪些内容