Sunday, March 11, 2018

Time altzone() Method


Time altzone() Method in Python 3


The method altzone() is the attribute of the time module. This returns the offset of the local DST timezone, in seconds west of UTC, if one is defined. This is negative if the local DST timezone is east of UTC (as in Western Europe, including the UK). Only use this if daylight is nonzero.

Syntax
time.altzone


Return Value
This method returns the offset of the local DST timezone, in seconds west of UTC, if one is defined.

Example

#!/usr/bin/python3
import time
print ("time.altzone : ", time.altzone)

When we run the above program, it produces the following result

time.altzone : -23400