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

WBOY
Release: 2016-06-06 11:17:15
Original
1286 people have browsed it

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

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

time.altzone
Copy after login

参数

  • NA

返回值

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

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

#!/usr/bin/python import time print "time.altzone %d " % time.altzone
Copy after login

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

time.altzone() 25200
Copy after login

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!