描述
方法altzone()是屬性time模塊。如果已定義,則返回本地 DST 時區的偏移量,以 UTC 以西的秒數為單位。如果本地 DST 時區在 UTC 以東(如西歐,包括英國),則此值為負數。僅當日光不為零時才使用此選項。
用法
以下是語法altzone()方法≫
time.altzone
參數
NA
返回值
如果已定義,此方法返回本地 DST 時區的偏移量,以 UTC 以西的秒數為單位。
示例
下麵的例子展示了 altzone() 方法的用法。
#!/usr/bin/python3
import time
print ("time.altzone:", time.altzone)
結果
當我們運行上麵的程序時,它會產生以下結果——
time.altzone: -23400
相關用法
- Python 3 time asctime()用法及代碼示例
- Python 3 time strftime()用法及代碼示例
- Python 3 time time()用法及代碼示例
- Python 3 time localtime()用法及代碼示例
- Python 3 time mktime()用法及代碼示例
- Python 3 time gmtime()用法及代碼示例
- Python 3 time sleep()用法及代碼示例
- Python 3 time ctime()用法及代碼示例
- Python 3 time tzset()用法及代碼示例
- Python 3 time strptime()用法及代碼示例
- Python 3 time clock()用法及代碼示例
- Python 3 Number tan()用法及代碼示例
- Python 3 os.fstatvfs()用法及代碼示例
- Python 3 List pop()用法及代碼示例
- Python 3 os.minor()用法及代碼示例
- Python 3 dictionary cmp()用法及代碼示例
- Python 3 String isupper()用法及代碼示例
- Python 3 os.close()用法及代碼示例
- Python 3 List index()用法及代碼示例
- Python 3 String decode()用法及代碼示例
注:本文由純淨天空篩選整理自 Python 3 - time altzone() Method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。