Home  >  Article  >  Backend Development  >  Python中用altzone()方法处理时区的教程

Python中用altzone()方法处理时区的教程

WBOY
WBOYOriginal
2016-06-06 11:17:151222browse

 altzone()方法是time模块的属性。当地的DST时区的这返回的偏移量,在UTC西部秒钟,如果一个定义。这是负值,如果当地的DST时区为UTC东边(如西欧,包括英国)。只有用这个,如果白天不为零。
语法

以下是altzone()方法的语法:

time.altzone

参数

  •     NA

返回值

当地的DST时区的这个方法返回的偏移量,在UTC西部秒钟,如果一个定义。
例子

下面的例子显示了altzone()方法的使用。

#!/usr/bin/python
import time

print "time.altzone %d " % time.altzone

当我们运行上面的程序,它会产生以下结果:

time.altzone() 25200

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn