linux TZ格式


man tzset可以很清楚了解時區設置格式,共3種:

The first format is used when there is no daylight saving time in the local timezone:
              std offset

The second format is used when there is daylight saving time:
              std offset dst [offset],start[/time],end[/time]

The third format specifies that the timezone information should be read from a file:
              :[filespec]
常用是前兩種格式。

The std string specifies the name of the timezone and must be three or more  alphabetic  characters.
The offset string immediately follows std and specifies the time value to be added to the local time to get Coordinated Universal Time (UTC). 

The offset is positive if the local timezone  is  west  of the  Prime  Meridian and negative if it is east.  The hour must be between 0 and 24, and the minutes and seconds 0 and 59.
std offset沒有夏令時的時區格式,即一個名稱加上與UTC的時間差值,就是說,當地時間加上時間差就得到UTC時間。如果時間差為正數,則時區位於本初子午線 (Prime Meridian)之西(西幾區),如果是負數,則時區位於本初子午線之東(東幾區),見加粗部分字體。所以CST6CDT是西六區的時區名稱。——因為 西六區加上6小時,正是UTC時間。CST-8是東八區,因為東八區減去8小時剛好是UTC時間

POSIX格式的時區介紹:http://www.ibm.com/developerworks/aix/library/au-aix-posix/index.html

GNU關於TZ變量的介紹:http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html

世界時區介紹、簡寫等:http://www.timeanddate.com/time/zones/

 

參考:

linux下時區的一些認識


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM